Author: dylan
Date: 2004-12-29 13:07:23 -0500 (Wed, 29 Dec 2004)
New Revision: 449

Added:
   trunk/web/README
Modified:
   trunk/web/Makefile
   trunk/web/bin/fixhtml
   trunk/web/templates/config
   trunk/web/templates/thanks
Log:
latest changes, including make upload and some config stuff.


Modified: trunk/web/Makefile
===================================================================
--- trunk/web/Makefile  2004-12-29 16:55:32 UTC (rev 448)
+++ trunk/web/Makefile  2004-12-29 18:07:23 UTC (rev 449)
@@ -1,12 +1,15 @@
 
+
+SFUSER    = $(shell cat ~/.sfuser)
 T         = templates
-DEPENDS  = $T/init $T/config bin/tt bin/fixhtml $I/macros/html
-
+DEPENDS  = $T/init $T/config bin/tt bin/fixhtml \
+                  $T/macros/html \
+                  $T/thanks \
+                  $T/sidebar \
+                  $T/menu 
 PERL5LIB  = ./lib
-
-
 TTFLAGS    = -I $T -P init -P config
-FIXFLAGS   = -R --noext
+FIXFLAGS   = --noext
 RSYNCFLAGS = -vaz --exclude '.svn'
 TIDYFLAGS  = -q
 
@@ -24,6 +27,9 @@
 FIX      = pperl $(FIX_PATH)
 endif
 
+ifdef DRY
+RSYNCFLAGS += --dry-run
+endif
 
 export PERL5LIB
 
@@ -35,7 +41,7 @@
 build: $(targets)
        
 upload:
-       echo "TODO"
+       $(RSYNC) $(RSYNCFLAGS) ./ 
$(SFUSER)@shell.sourceforge.net:/home/groups/h/ha/haver/htdocs/
        
 clean:
        rm -vf $(targets)
@@ -44,7 +50,7 @@
        validate $(html)
 
 
-%.html: %.thtml
+%.html: %.thtml $(DEPENDS)
        @echo "TT   $<"
        @$(TT) $(TTFLAGS) $< > $@
        @echo "FIX  $@"

Added: trunk/web/README
===================================================================
--- trunk/web/README    2004-12-29 16:55:32 UTC (rev 448)
+++ trunk/web/README    2004-12-29 18:07:23 UTC (rev 449)
@@ -0,0 +1,22 @@
+
+We require a few standard tools to build the haver website:
+  perl
+  Template Toolkit, from CPAN as Template.
+  GNU Make
+  XML::DOM
+  html tidy.
+  validate - Offline HTMLHelp.com Validator.
+
+to build the entire site, just type "make build".
+To validate all the html pages, type "make validate".
+
+Finally, to upload (to source forge), first make sure you're part of the haver 
group on Source Forge,
+and second, put your sf user name in ~/.sfuser. Then just type "make upload".
+
+Whenever you edit anything, make sure to svn commit. After svn commit,
+make build (or make file.html for a single file), make validate, and make 
upload.
+
+If you have pperl installed, you can increase the speed with which the site is 
built via:
+make FAST=1 build
+
+To only pretend to upload, do make DRY=1 upload.

Modified: trunk/web/bin/fixhtml
===================================================================
--- trunk/web/bin/fixhtml       2004-12-29 16:55:32 UTC (rev 448)
+++ trunk/web/bin/fixhtml       2004-12-29 18:07:23 UTC (rev 449)
@@ -28,18 +28,10 @@
 my $parser = new XML::DOM::Parser;
 my %opt = (
        verbose   => 0,
-       root      => '/',
-       pattern   => '/',
-       base      => '.',
-       relative  => 0,
     extension => 1,
 );
 
 GetOptions(\%opt,
-       'root|r=s', 
-       'base|b=s',
-       'pattern|p=s',
-       'relative|R',
        'verbose|v+',
     'extension|ext!',
 );
@@ -62,9 +54,6 @@
                foreach my $k (keys %o) {
                        $opt{$k} = $o{$k};
                }
-               if (not $opt{root}) {
-                       $opt{root}='';
-               }
        }
        s{//<!\[CDATA\[\n}{<!--\n}sg;
        s{//\]\]>\n}{// -->}sg;
@@ -143,38 +132,35 @@
 }
 sub rewrite_url {
        my ($url, $file) = @_;
-       
-       if (not $opt{relative}) {
-        print STDERR "Relative!\n";
-               $url =~ s!^$opt{pattern}!$opt{root}!;
-               return $url;
-       } else {
-               # ignore 
-               return $url unless $url =~ m!^/!;
-        return $url if $url =~ /\?/;
-               my $dirs;
-               (undef, $dirs, undef) = File::Spec::Unix->splitpath($file);
-               my $ret;
-               if ($url eq "/$dirs") {
-                       $ret = '.';
-               } else {
-                       $ret = File::Spec::Unix->abs2rel($url, "/$dirs");
-               }
-               if ($opt{verbose}) {
-                       print STDERR "f('$url', '/$dirs') == '$ret'\n";
-               }
-        if (not $ret) {
-            $ret = '.';
-        } else {
-            if (not $opt{ext}) {
-                $ret =~ s/(index)?\.\w+$//;
-            }
+    my ($dirs, $ret);
+    
+    return $url unless $url =~ m!^/!;
+    return $url if $url =~ /\?/;
+    
+    (undef, $dirs, undef) = File::Spec::Unix->splitpath($file);
+
+    if ($url eq "/$dirs") {
+        $ret = '.';
+    } else {
+        $ret = File::Spec::Unix->abs2rel($url, "/$dirs");
+    }
+    if ($opt{verbose}) {
+        print STDERR "f('$url', '/$dirs') == '$ret'\n";
+    }
+
+    if ($ret eq 'index.html') {
+        $ret = '.';
+    }
+    if (not $ret) {
+        $ret = '.';
+    } else {
+        if (not $opt{ext}) {
+            $ret =~ s/\.\w+$//;
         }
+    }
 
 
-               return $ret;
-       }
-               
+    return $ret;
 }
 
 sub get_file_from_src {

Modified: trunk/web/templates/config
===================================================================
--- trunk/web/templates/config  2004-12-29 16:55:32 UTC (rev 448)
+++ trunk/web/templates/config  2004-12-29 18:07:23 UTC (rev 449)
@@ -14,6 +14,16 @@
 
 
 
-config.title = "The Haver Project";
+# Set to 0 if not using source forge.
+config.using_sf = 1;
+config.title    = "The Haver Project";
 
+people.nornagon = {
+    email => '[EMAIL PROTECTED]',
+};
+
+people.dylan = {
+    email => '[EMAIL PROTECTED]',
+};
+
 %]

Modified: trunk/web/templates/thanks
===================================================================
--- trunk/web/templates/thanks  2004-12-29 16:55:32 UTC (rev 448)
+++ trunk/web/templates/thanks  2004-12-29 18:07:23 UTC (rev 449)
@@ -15,15 +15,23 @@
 
 [%# Debian  %]
 <a href="http://www.debian.org/";>
-<img class='logo' src='/images/debian-powered' alt="Powered by Debian!" /></a>
+<img class='logo' src='/images/debian-powered.png' alt="Powered by Debian!" 
/></a>
 
+[%# Source Forge %]
+[% IF config.using_sf %]
+[% GID = 127478 %]
+<a href="http://sourceforge.net";><img
+src="http://sourceforge.net/sflogo.php?group_id=$GID&amp;type=1"; width="88"
+height="31" style="border:0;"  alt="SourceForge.net Logo" /></a>
+[% END %]
+
 [%# Template Toolkit  %]
 <a href="http://www.template-toolkit.org/";>
-<img class='logo' src='/images/tt2-powered' alt="Powered by Template Toolkit" 
/></a>
+<img class='logo' src='/images/tt2-powered.png' alt="Powered by Template 
Toolkit" /></a>
 
 [%# Vim %] 
 <a href="http://www.vim.org/";>
-<img class='logo' src='/images/vim-created' alt="Created in Vim!" /></a>
+<img class='logo' src='/images/vim-created.png' alt="Created in Vim!" /></a>
 </p>
 
 <p class="credits" style="text-align: right; font-size: 8pt;">


Reply via email to