bliper

static html page generation in perl
git clone git://git.2f30.org/bliper
Log | Files | Refs | README | LICENSE

commit 53bd8e10d482d67e9f4be6dd49855c9cf160bf55
parent 5b7ae48740644553182d1160d387b40995053a35
Author: cipher <haris@2f30.org>
Date:   Wed, 27 Nov 2013 01:51:43 +0200

added disqus support

Diffstat:
Mbin/bliper-generate.pl | 10++++++----
Atemplate/article-bottom | 21+++++++++++++++++++++
Atemplate/article-top | 13+++++++++++++
3 files changed, 40 insertions(+), 4 deletions(-)

diff --git a/bin/bliper-generate.pl b/bin/bliper-generate.pl @@ -11,8 +11,10 @@ my $pagedir = 'pages'; # individual pages directory my @maint = qx(cat template/main-top); # top section for main page my @mainb = qx(cat template/main-bottom); # bottom section for main page my @footer = qx(cat template/footer); # footer for every page incl main -my @paget = qx(cat template/page-top); # top section for every page in input/ -my @pageb = qx(cat template/page-bottom); # bottom section for every page in input/ +my @paget = qx(cat template/page-top); # top section for every page in pages/ +my @pageb = qx(cat template/page-bottom); # bottom section for every page in pages/ +my @articlet = qx(cat template/article-top); # top section for every article in main-articles/ +my @articleb = qx(cat template/article-bottom); # bottom section for every article in main-articles/ unlink glob "output/*.html"; # remove old pages unlink "output/tmp"; # file which stores menu @@ -60,10 +62,10 @@ foreach my $file (@files) { # Read each file(post) from indir, cat to $outdi print "\t==> output file:\t" . "../$outdir/$file.html\n"; my @array = qx(cat $file); open (OUT, '>', "../$outdir/$file.html") or die $!; - print OUT @paget; + print OUT @articlet; my @html = qx(Markdown.pl $file); # markdown to html print OUT @html; # append content - print OUT @pageb; + print OUT @articleb; close OUT; open (OUT, '>>', "../$outdir/index.html") or die $!; # append links to stories in index.html diff --git a/template/article-bottom b/template/article-bottom @@ -0,0 +1,21 @@ +<a href="#start"><p class="upstart">^</p></a> +</div> <!-- container end --> +<hr> +<!-- uncomment to use disqus. Remember to change <example> to shortname +<div id="disqus_thread"></div> +<script type="text/javascript"> + /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */ + var disqus_shortname = '<example>'; // Required - Replace example with your forum shortname + + /* * * DON'T EDIT BELOW THIS LINE * * */ + (function() { + var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; + dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js'; + (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); + })(); +</script> +<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> + disqus --> +<footer>Made with vim and generated by Perl in bliper.</footer> +</body> +</html> diff --git a/template/article-top b/template/article-top @@ -0,0 +1,13 @@ +<!DOCTYPE HTML> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=utf-8" /> + <title>perl test</title> + <link href="style.css" rel="stylesheet" type="text/css" /> +</head> +<body> +<div class="container"> <!-- container begin --> +<a name="start"></a> +<img src="images/sample.jpg" /> +Welcome to my blog... +INSERTMENU