Commits

Anonymous committed bf9675c

Added the skeleton of the latemp-based-site.

We use latemp as a temporary CMS, until we find something better.

Comments (0)

Files changed (14)

latemp-based-site/Makefile

+
+RSYNC = rsync --progress --verbose --rsh=ssh
+
+ALL_DEST_BASE = dest
+
+DOCS_COMMON_DEPS = template.wml lib/MyNavData.pm lib/MyManageNews.pm
+
+WML_FLAGS = -DLATEMP_THEME=better-scm
+
+LATEMP_WML_FLAGS =$(shell latemp-config --wml-flags)
+
+WML_FLAGS += --passoption=2,-X3074 --passoption=3,-I../../lib/ \
+	--passoption=3,-w $(LATEMP_WML_FLAGS) -I../../ -DROOT~. \
+    -I../../lib/
+
+all: dummy
+
+%.show:
+	@echo "$* = $($*)"
+
+include include.mak
+include rules.mak
+
+# Add news_feeds to this target if you want to generate an RSS feed.
+dummy : latemp_targets
+
+RSS_FEED = $(IGLU.ORG.IL_DEST)/rss.xml
+
+news_feeds: $(RSS_FEED)
+
+$(RSS_FEED): gen-feeds.pl lib/MyManageNews.pm
+	perl -Ilib gen-feeds.pl --rss2-out="$@"
+
+.PHONY: 
+
+upload: all
+	cd $(ALL_DEST_BASE)/iglu.org.il && \
+	$(RSYNC) -r * shlomif@tux:/srv/raid/http/iglu.org.il

latemp-based-site/gen-feeds.pl

+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use MyManageNews;
+use Getopt::Long;
+
+my $rss2_out = "dest/rss.xml";
+GetOptions ("rss2-out=s" => \$rss2_out);
+
+my $news_manager = get_news_manager();
+
+$news_manager->generate_rss_feed(
+    'output_filename' => $rss2_out,
+);
+
+1;

latemp-based-site/gen-helpers.pl

+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use HTML::Latemp::GenMakeHelpers;
+
+my $generator = 
+    HTML::Latemp::GenMakeHelpers->new(
+        'hosts' =>
+        [ 
+            map 
+            { 
+                +{ 'id' => $_, 'source_dir' => "src/$_", 
+                   'dest_dir' => "\$(ALL_DEST_BASE)/$_",
+               }, 
+            } 
+            (qw(common iglu.org.il))
+        ]
+    );
+
+$generator->process_all();
+
+1;

latemp-based-site/lib/MyManageNews.pm

+package MyManageNews;
+
+use base 'Exporter';
+
+our @EXPORT=(qw(get_news_manager));
+
+use strict;
+use warnings;
+
+use HTML::Latemp::News;
+
+my @news_items =
+(
+    (map 
+        { 
+            +{%$_, 
+                'author' => "Shlomi Fish", 
+                'category' => "My Site Category", 
+            }
+        }
+        (
+            # TODO: Fill Items Here.
+        ),
+    )
+);
+
+sub gen_news_manager
+{
+    return
+        HTML::Latemp::News->new(
+            'news_items' => \@news_items,
+            'title' => "My Site News",
+            'link' => "http://www.link-to-my-site.tld/",
+            'language' => "en-US",
+            'copyright' => "Copyright by Shlomi Fish, (c) 2005",
+            'webmaster' => "Shlomi Fish <author\@domain.org>",
+            'managing_editor' => "Shlomi Fish <author\@domain.org>",
+            'description' => "News of the My Site",
+        );
+}
+
+# A singleton.
+{
+    my $news_manager;
+
+    sub get_news_manager
+    {
+        if (!defined($news_manager))
+        {
+            $news_manager = gen_news_manager();
+        }
+        return $news_manager;
+    }
+}
+
+1;

latemp-based-site/lib/MyNavData.pm

+package MyNavData;
+
+use strict;
+use warnings;
+
+use MyManageNews;
+
+my $hosts =
+{
+    'iglu.org.il' =>
+    {
+        'base_url' => "http://myhost.mydomain/",
+    },
+};
+
+my $news_manager = get_news_manager();
+
+sub get_news_category
+{
+    my $items = $news_manager->get_navmenu_items('num_items' => 5);
+    if (@$items)
+    {
+        return
+        {
+            'text' => "News",
+            'url' => "news/",
+            'subs' =>
+            [
+                @$items,
+            ],
+        },
+    }
+    else
+    {
+        return ();
+    }
+}
+
+my $tree_contents =
+{
+    'host' => "iglu.org.il",
+    'text' => "My Site",
+    'title' => "My Site",
+    'subs' =>
+    [
+        {
+            'text' => "Home",
+            'url' => "",
+        },
+        {
+            'text' => "About",
+            'url' => "about.html",
+        },
+        get_news_category(),
+        {
+            'text' => "Links",
+            'url' => "links.html",
+        },
+    ],
+};
+
+sub get_params
+{
+    return
+        (
+            'hosts' => $hosts,
+            'tree_contents' => $tree_contents,
+        );
+}
+
+1;

latemp-based-site/lib/MyNavLinks.pm

+package MyNavLinks;
+
+use base 'HTML::Latemp::NavLinks::GenHtml::Text';
+
+1;

latemp-based-site/params-latemp.yml

+---
+prefix: /home/shlomi/apps/latemp
+program:
+  author: Shlomi Fish
+  name: Latemp
+version: 0.4.0
+versioning_scheme: 0

latemp-based-site/src/common/print.css

+.navbar 
+{
+    display: none;
+}
+.main
+{
+    background-color : white;
+}
+p.desc { margin-left : 3em }
+.note 
+{ 
+    border-color : black; 
+    border-style : double;
+    padding : 0.5em;
+}
+.righty
+{
+   float: right;
+   text-align: center;
+   font-size: 80%;
+   width: 30%;
+}
+.righty img
+{
+    border : 0;
+}
+.webmaster
+{
+    float : left;
+}
+.center
+{
+    text-align : center;
+}
+.leading_path
+{
+    padding-left: 0.5em;
+    padding-top: 0.2em;
+    padding-bottom: 0.2em;
+    margin-bottom : 0.2em;
+    border-width : thin;
+    border-color : black;
+    border-style : groove;
+    font-size: 85%;
+}
+.footer {
+    clear : both;
+    margin-right : 30px;
+    padding-top: 0.5em;
+}
+tt { font-weight: bold; }
+pre
+{
+    padding-left: 1em;
+    padding-right: 1em;
+    padding-bottom: 0.5em;
+    padding-top: 0.5em;
+    border-width : thin;
+    border-color: #004000;
+    border-style: solid;
+}
+/* Border-less */
+.bless
+{
+    border : none;
+}

latemp-based-site/src/common/style.css

+/*
+    CSS Stylesheet for better-scm.berlios.de
+    Copyright (c) Shlomi Fish, 2003-2005
+    Feel free to use, modify and re-distribute under the terms of the 
+    MIT X11 License (http://www.opensource.org/licenses/mit-license.php)
+
+    $Id: style.css 175 2005-04-17 07:43:41Z shlomif $
+*/
+
+a:hover { color : red }
+
+.navbar {
+    float : left;
+    background-color : #C5CAE2;
+    width : 200px;
+    padding-left : 0.5em;
+    padding-top : 0.5em;
+}
+
+.main
+{
+    padding-left : 1em;
+    padding-bottom : 1em;
+    padding-top : 0em;
+    padding-right: 1em;
+    margin-left : 220px;
+    margin-top: 1em;
+    margin-right: 1em;
+    background-color : white;
+    border: thin solid black;
+}
+
+p.desc { margin-left : 3em }
+h2 
+{ 
+    background-color: #FFEE00  
+}
+h2, h3, h4
+{
+    padding-left: 0.3em;
+}
+.main p
+{
+    padding-left : 1em;
+}
+.link { background : transparent; }
+/* Opera has a very wide default for margin-left, which causes the navbar
+   to be misrendered. This rule fixes it.
+   */
+.navbar ul
+{
+    margin-left: 0;
+}
+ul.navbarmain
+{ 
+    padding-left : 1em; 
+    font-size: 80%;
+    font-family: sans-serif;
+}
+ul.navbarnested 
+{ 
+    padding-left : 0em ; 
+    margin-left : 2em;
+}
+.note 
+{ 
+    border-color : black; 
+    border-style : double;
+    padding : 0.5em;
+    background-color : #98FB98; /* PaleGreen */
+}
+.note h2
+{
+   background: transparent;
+}
+ul.my li
+{
+    padding-bottom: 0.5em;
+}
+.righty
+{
+   float: right;
+   text-align: center;
+   font-size: 80%;
+   width: 30%;
+}
+.righty img
+{
+    border : 0;
+}
+.foot_left
+{
+    float : left;
+}
+.webmaster
+{
+    margin-bottom: 0em;
+}
+.vcs
+{    
+    margin-top: 0.5em;
+    clear: left;
+}
+.vcs tt
+{
+    font-size: 83%;
+}
+
+.center
+{
+    text-align : center;
+}
+.nav_links
+{
+    text-align: center;
+    padding-left : 0em;
+    padding-top : 0em;
+}
+.nav_links li
+{
+    display: inline;
+    list-style-type: none;
+    padding-right: 0.2em;
+    padding-top: 0em;
+}
+.leading_path
+{
+    padding-left: 0.5em;
+    padding-top: 0.2em;
+    padding-bottom: 0.2em;
+    background-color : #40C040;
+    /* background-color: #FF7070; */
+    margin-bottom : 0.2em;
+    font-size: 85%;
+}
+.leading_path :hover
+{
+    color : yellow;
+}
+.footer {
+    clear : both;
+    margin-right : 30px;
+    padding-top: 0.5em;
+}
+/* Workaround to get the <hr /> element at the bottom to properly display 
+   with Konqueror 3.3.x
+   */
+.footer hr
+{
+    width:100%;
+    clear:both;
+}
+tt { color : #8a2be2; }
+pre
+{
+    padding-left: 1em;
+    padding-right: 1em;
+    padding-bottom: 0.5em;
+    padding-top: 0.5em;
+    background-color: #FF8080;
+    border-width : thin;
+    border-color: #004000;
+    border-style: solid;
+}
+/* Border-less */
+.bless
+{
+    border : none;
+}

latemp-based-site/src/iglu.org.il/about.html.wml

+#include "template.wml"
+
+<latemp_subject "About this site" />
+<latemp_version_control_id "$Id$" />
+
+<p>
+Here you should put information about this site. A good idea may be moving
+it to about/index.html.wml.
+</p>
+

latemp-based-site/src/iglu.org.il/index.html.wml

+#include "template.wml"
+
+<latemp_subject "My Subject" />
+<latemp_version_control_id "$Id$" />
+

latemp-based-site/src/iglu.org.il/links.html.wml

+#include "template.wml"
+
+<latemp_subject "Links" />
+<latemp_version_control_id "$Id$" />
+
+<h2>Latemp Related Links</h2>
+
+<ul>
+<li>
+<a href="http://web-cpan.berlios.de/latemp/">The Latemp Homepage</a>
+</li>
+<li>
+<a href="http://thewml.org/">Web Meta Language</a>
+</li>
+</ul>

latemp-based-site/template.wml

+# Read all the latemp macros 
+#include "latemp/latemp-prelude.wml"
+
+# You can put some customizations here
+
+<set-var latemp_with_head_meta_tags="1" />
+
+# Actually start the page template.
+#include "latemp/latemp-driver.wml"
+<latemp_lang "en-GB" />
+<latemp_encoding "utf-8" />
+<latemp_common_keywords "" />
+<latemp_author "Shlomi Fish" />
+
+<latemp_webmaster>
+</latemp_webmaster>
+
+<latemp_license>
+</latemp_license>
+
+<latemp_affiliations_buttons>
+</latemp_affiliations_buttons>

latemp-based-site/unchanged

Empty file added.