Skip to content

Commit

Permalink
improved design
Browse files Browse the repository at this point in the history
  • Loading branch information
ap0calypse committed Mar 7, 2012
1 parent 6f12ef3 commit 5b5ac01
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 8 deletions.
17 changes: 9 additions & 8 deletions bzg
Original file line number Diff line number Diff line change
Expand Up @@ -777,12 +777,12 @@ sub generate_file {
if ($line =~ m/\[CONTENT\]/gmx) {
if ($type ne "tags") {
$line =~ s/\[CONTENT\]//gmx;
$line .= "<h2>$BZG_HASH->{$type}{$id}{'title'}</h2>";
$line .= "<div class='onecont'><h2>$BZG_HASH->{$type}{$id}{'title'}</h2>";
$line .= convert_text($BZG_HASH->{$type}{$id}{'text'}, $id);
}
else {
$line =~ s/\[CONTENT\]//gmx;
$line .= "<h2>Articles with tag: $id</h2>";
$line .= "<div class='onecont'><h2>Articles with tag: $id</h2>";
for (@{$TAG_HASH{$id}}) {
my $dirstring = $BZG_HASH->{'articles'}{$_}{'title'};
($year, $month, $day) = split (/-/, $BZG_HASH->{'articles'}{$_}{'date'});
Expand All @@ -800,18 +800,19 @@ sub generate_file {
$BZG_HASH->{'articles'}{$_}{'title'} .
"</a></p>" unless $line eq 'articles';
}
$line .= "</div>";
}
if ($type eq 'articles') {
$line .= "<div class='b_art_info'>posted by " . $BZG_HASH->{$type}{$id}{'author'} .
" in " . join(", ", split / /, $BZG_HASH->{$type}{$id}{'tags'}) . " on <i>" .
$BZG_HASH->{$type}{$id}{'date'} . " " . $BZG_HASH->{$type}{$id}{'time'} .
"</i></div>";
"</i></div></div>";
}
elsif ($type eq 'pages') {
$line .= "<div class='b_art_info'>posted by " . $BZG_HASH->{$type}{$id}{'author'} .
" on <i>" .
$BZG_HASH->{$type}{$id}{'date'} . " " . $BZG_HASH->{$type}{$id}{'time'} .
"</i></div>";
"</i></div></div>";
}
}

Expand Down Expand Up @@ -892,12 +893,12 @@ sub generate_index {
$dirstring =~ s/ +/-/g;
$dirstring =~ s/[^a-z0-9A-Z-]//g;
$dirstring = lc(substr($dirstring, 0, 30));
$line .= "<h2><a href='./articles/$year/$month/$day/$dirstring.html'>$BZG_HASH->{'articles'}{$id}{'title'}</a></h2>";
$line .= "<div class='onecont'><h2><a href='./articles/$year/$month/$day/$dirstring.html'>$BZG_HASH->{'articles'}{$id}{'title'}</a></h2>";
$line .= convert_text($BZG_HASH->{'articles'}{$id}{'text'}, $id, "index");
$line .= "<div class='b_art_info'>posted by " . $BZG_HASH->{'articles'}{$id}{'author'} .
" in " . join(", ", split / /, $BZG_HASH->{'articles'}{$id}{'tags'}) . " on <i>" .
$BZG_HASH->{'articles'}{$id}{'date'} . " " . $BZG_HASH->{'articles'}{$id}{'time'} .
"</i></div>";
"</i></div></div>";
}
}
}
Expand Down Expand Up @@ -1031,8 +1032,8 @@ sub convert_text {
}
elsif ($in_code) {
$_ =~ s/'/´/gmx;
$finaltext .= `echo '$_' | highlight -s 'vampire' -I -f -l -m $line_number --inline-css -S $code_lang` if $want_ln;
$finaltext .= `echo '$_' | highlight -s 'vampire' -I -f --inline-css -S $code_lang` unless $want_ln;
$finaltext .= `echo '$_' | highlight -s 'bclear' -I -f -l -m $line_number --inline-css -S $code_lang` if $want_ln;
$finaltext .= `echo '$_' | highlight -s 'bclear' -I -f --inline-css -S $code_lang` unless $want_ln;
$line_number++;
}
elsif ($in_gnuplot) {
Expand Down
97 changes: 97 additions & 0 deletions examples/style-improved.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
body {
font-family: monospace, Verdana, Arial, Helvetica, sans-serif;
font-size: 14px;
background-color: #ccc;
color: #222;
}

div.content h2 {
padding-top: 15px;
}

a, a:active, a:visited {
color: #000;
text-decoration: none;
}

a:hover {
color: #555;
text-decoration: none;
}


div.onecont {
float: left;
border: solid 1px #222;
padding: 10px;
width: 725px;
margin-bottom: 10px;
}

div.heading {
padding: 10px;
margin-left: 50px;
margin-right: auto;
margin-bottom: 10px;
width: 950px;
height: 80px;
border: solid 1px #222;
}

div.rss {
float: right;
text-align: right;
}

pre.sourcecode {
border: solid 1px #aaa;
padding: 5px;
background: #bbb;
}

div.b_art_info {
font-size: 10px;
background-color: #ddd;
color: #222;
border: solid 1px #aaa;
padding: 4px;
}


div.menu {
float: left;
width: 190px;
height: 500px;
border: solid 1px #222;
padding: 10px;
}

div.menupoint {
border: solid 1px #aaa;
padding: 5px;
background: #ddd;
font-size: 12px;
color: #000;
font-weight: bold;
}

div.content {
margin-left: 10px;
float: left;
width: 725px;
min-height: 500px;
}

div.main {
margin-left: 50px;
margin-right: auto;
width: 970px;
}

div.code {
margin-left: 10px;
margin-right: 10px;
background-color: #eee;
padding: 5px;
border: solid 1px #222;
}

0 comments on commit 5b5ac01

Please sign in to comment.