From: Matt S Trout Date: Wed, 4 Nov 2009 19:35:18 +0000 (+0000) Subject: use pages/index.html if present X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6de3a91eeec16bc227d4069e617ed1e62e5c3872;p=sdlgit%2FSDL-Site.git use pages/index.html if present --- diff --git a/assets/background_body.jpg b/assets/background_body.jpg new file mode 100644 index 0000000..ddc6d25 Binary files /dev/null and b/assets/background_body.jpg differ diff --git a/assets/background_divmain.jpg b/assets/background_divmain.jpg new file mode 100644 index 0000000..c7a69b2 Binary files /dev/null and b/assets/background_divmain.jpg differ diff --git a/assets/cards1.jpg b/assets/cards1.jpg new file mode 100644 index 0000000..ab690c7 Binary files /dev/null and b/assets/cards1.jpg differ diff --git a/assets/default.css b/assets/default.css new file mode 100644 index 0000000..c6066ba --- /dev/null +++ b/assets/default.css @@ -0,0 +1,92 @@ + +body +{ + font-family: Arial, Helvetica, sans-serif; + font-size: 12px; + font-weight: normal; + color: #000000; + background-color: #CAB680; + text-align: left; + padding: 0; + margin: 0; + text-align: center; + vertical-align: middle; +} + +a +{ + font-size: 14px; + font-weight: bold; + color: #49241D; + text-decoration: none; +} + +a:hover +{ + color: #864135; + text-decoration: underline; +} + +div#background +{ + padding: 0; + margin: auto; + width: 1015; + height: 749; + text-align: left; + vertical-align: top; +} + +table#mainTable +{ + table-layout: fixed; + background-image: url(background_body.jpg); + background-position: top left; + background-repeat: no-repeat; +} + +table#mainTable, +table#mainTable td +{ + padding: 0; + margin: 0; + border: 0; +} + +td#upperLeft +{ + width: 103px; + height: 144px; +} + +td#upperRight +{ + width: 912px; + background-image: url(cards1.jpg); + background-position: 550px 5px; + background-repeat: no-repeat; + text-align: right; + vertical-align: bottom; + font-variant: small-caps; +} + +td#lowerRight +{ + background-color: #D6C796; + min-height: 603px; + text-align: left; + vertical-align: top; + background-image: url(background_divmain.jpg); + background-position: 1px 1px; + background-repeat: no-repeat; +} + +div#main +{ + padding: 0; + margin: 0; + border: 1px solid #FFFFFF; + width: 910px; + min-height: 601px; + overflow: hidden; +} diff --git a/assets/pod.css b/assets/pod.css new file mode 100644 index 0000000..f26c732 --- /dev/null +++ b/assets/pod.css @@ -0,0 +1,12 @@ + +div.pod +{ + padding: 10px; +} + +pre +{ + border: 1px solid #FFFFFF; + background-color: #CAB680; + padding-top: 10px; +} \ No newline at end of file diff --git a/sdl.cgi b/sdl.cgi index 34415b5..fc58aa4 100755 --- a/sdl.cgi +++ b/sdl.cgi @@ -42,10 +42,20 @@ dispatch [ sub layout_zoom { my $self = shift; $self->{layout_zoom} ||= do { - HTML::Zoom->from_string($self->_read_data) + HTML::Zoom->from_string($self->_layout_html) }; } +sub _layout_html { + my $self = shift; + my $file = $self->config->{pages_dir}.'/index.html'; + if (-f $file) { + return do { local(@ARGV, $/) = ($file); <> } + } else { + return $self->_read_data + } +} + sub render_html { my ($self, $data) = @_; return $data if ref($data) eq 'ARRAY';