diff options
-rwxr-xr-x | ssg | 21 |
1 files changed, 16 insertions, 5 deletions
@@ -15,9 +15,11 @@ my $outdir; my $VERSION = "v0.1"; my @exlude_files = ( - qr/TIL\/\w+\/*/ + qr/log\/\w+\/*/ ); +my $with_sidebar = 1; + sub help { print<<EOF $0 [switches] input-directory @@ -52,7 +54,10 @@ sub markdown { sub generate_page { my $file = $_[0]; - my $sidebar = transverse($indir, $file); + my $sidebar = ""; + if($with_sidebar) { + $sidebar = transverse($indir, $file); + } my $styles = styles; my $body = markdown $file; my $page = <<EOF @@ -70,7 +75,7 @@ $styles <body> <div class="header"> <h1 class="headerTitle"> -<a href="/">Deprecated</a> <span class="headerSubtitle">Just coding for fun</span> +<a href="/">Deprecated</a> <span class="headerSubtitle">Coding for fun</span> </h1> </div> @@ -100,6 +105,7 @@ sub generate_link { # Exclude links given($file) { when(@exlude_files) { + say "excluding $file"; return ""; } default { @@ -202,9 +208,10 @@ sub run_on { my %opts = ( 'v' => 0, 'h' => 0, - 'o' => "site.static/" + 'o' => "site.static/", + 's' => 1, ); -getopts('vho:', \%opts); +getopts('svho:', \%opts); $indir = shift @ARGV; if($opts{h}) { @@ -220,6 +227,10 @@ if(-d $opts{o}) { remove_tree($opts{o}); } +if($opts{s}) { + $with_sidebar = $opts{s}; +} + mkdir $opts{o}; $outdir = $opts{o}; |