Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added index.tt and first draft of buildsite

  • Loading branch information...
commit ee0f5092586a0d92f261bb1da163c60db005263e 1 parent 1e51c29
Dave Cross authored
Showing with 57 additions and 0 deletions.
  1. +22 −0 buildsite
  2. +35 −0 index.tt
22 buildsite
View
@@ -0,0 +1,22 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use 5.010;
+
+use Template;
+
+open my $cd_fh, '<', 'cds.txt' or die $!;
+my $cds;
+
+my @cols = qw[code year title];
+while (<$cd_fh>) {
+ chomp;
+ my %cd;
+ @cd{@cols} = split /\t/;
+ push @$cds, \%cd;
+}
+
+my $tt = Template->new;
+$tt->process('index.tt', { cds => $cds }, 'index.html')
+ or die $tt->error;
35 index.tt
View
@@ -0,0 +1,35 @@
+<html>
+ <head>
+ <title>Cooking Vinyl Compilation CDs</title>
+ <link rel="stylesheet" href="style.css" type="text/css" />
+ </head>
+ <body>
+ <h1>Cooking Vinyl Compilation CDs</h1>
+ <p>A list of compilations released by
+ <a href="http://www.cookingvinyl.com/">Cooking Vinyl</a> records.</p>
+ <table>
+[% FOREACH cd IN cds -%]
+ <tr>
+[% IF cd.title;
+ code = cd.code.split(' ') -%]
+ <td><a href="grillcd[% code.2 %].html">[% cd.code IF cd.code %]</a></td>
+[% ELSE -%]
+ <td>[% cd.code IF cd.code -%]</td>
+[% END -%]
+ <td>[% cd.year IF cd.year %]</td>
+ <td>[% cd.title IF cd.title %]</td>
+ </tr>
+[% END -%]
+ </table>
+ <address>
+ Site created by <a href="mailto:dave@dave.org.uk">Dave Cross</a>
+ </address>
+ <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
+ </script>
+
+ <script type="text/javascript">
+_uacct = "UA-56332-2";
+urchinTracker();
+ </script>
+ </body>
+</html>
Please sign in to comment.
Something went wrong with that request. Please try again.