commit dfb52f435d12db2a2848cfe668d37503650ab413
parent 18893f3192721144e82497dce751864faa4437e4
Author: NunoSempere <nuno.sempere@protonmail.com>
Date: Thu, 10 Mar 2022 23:08:20 +0000
tweak: Aesthetic improvements to blagh
Diffstat:
7 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/apps/blagh/app.rc b/apps/blagh/app.rc
@@ -9,7 +9,7 @@ fn conf_enable_blog {
conf_blog_editors=blog-editors
if(~ $"conf_max_posts_per_page '')
- conf_max_posts_per_page=32
+ conf_max_posts_per_page=16
}
fn blagh_init {
@@ -72,20 +72,28 @@ fn blagh_setup_feed_handlers {
fn blagh_body {
if (! ~ $"blogTitle '')
- echo '<h1>'$"blogTitle'</h1>'
+ echo '<h2>'$"blogTitle'</h2>'
# Direct links to feeds are disabled because they are not very useful, add clutter and might waste pagerank.
# An user can add this on their own using handlers_body_head anyway.
- #echo '<div style="text-align:right">(<a href="index.rss">RSS Feed</a>|<a href="index.atom">Atom Feed</a>)</div>'
+ echo '<div style="text-align:left"><a href="index.rss">RSS Feed</a></div>'
+ # |<a href="index.atom">Atom Feed</a></div>'
+ # Markdown posts
# XXX Not sure why this fixes issues with blog setup, probably bug in fltr_cache!
for(p in `{get_post_list $blagh_root^$blagh_dirs}) {
l=`{echo -n $p|sed 's!'$sitedir^'/?(.*)([0-9][0-9][0-9][0-9]/[0-9][0-9]/[0-9][0-9])(/[^/]+/)!\2 /\1\2\3!'}
sed '1s!.*^') ('^$l(1)^')!' < $p/index.md
+ # cat $p/index.md | sed '1s!.*^') ('^$l(1)^')!' | sed -n '/^.\{15\}/p' | echo
echo # Needed extra \n so markdown doesn't mess up the formatting, probably can be done in sed.
- } head -n 9 | $formatter | sed 's/h[2-9]/i/g'| sed 's/h1/h3/g'
- # ^ take the first 9 lines of markdown, convert them to html. Then make h1->h3 and h_i -> cursive. This makes it more like a preview rather than all the posts pasted together.
- # XXX BUG! Markdown [references] break because multiple markdown documents are merged. Should format each blog post independently.
+ echo #
+ } | head -n 9 | $formatter | sed 's/h[2-9]/i/g'| sed 's/h1/h3/g'
+ # HTML posts
+ for(p in `{get_post_list $blagh_root^$blagh_dirs}) {
+ cat < $p/index.html
+ echo # Needed extra \n so markdown doesn't mess up the formatting, probably can be done in sed.
+ } | sed 's/h[2-9]/i/g' | sed 's/h1/h3/g' | head -n 5
+ # XXX BUG! Markdown [references] break because multiple markdown documents are merged. Should format each blog post independently.
# TODO: use fltr_cache directly, that can fix the previous bug plus provide a perf boost by caching title generation.
}
diff --git a/apps/blagh/atom.tpl b/apps/blagh/atom.tpl
diff --git a/apps/blagh/jsonfeed.tpl b/apps/blagh/jsonfeed.tpl
diff --git a/apps/blagh/new_post.tpl b/apps/blagh/new_post.tpl
diff --git a/apps/blagh/rss20.tpl b/apps/blagh/rss20.tpl
diff --git a/apps/duckduckgo/HOWTO b/apps/duckduckgo/HOWTO
diff --git a/apps/duckduckgo/footer.inc.sample b/apps/duckduckgo/footer.inc.sample