tweak: Aesthetic improvements to blagh

This commit is contained in:
NunoSempere 2022-03-10 23:08:20 +00:00
parent 18893f3192
commit dfb52f435d
7 changed files with 14 additions and 6 deletions

18
apps/blagh/app.rc Normal file → Executable file
View File

@ -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,19 +72,27 @@ 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(2)^') ('^$l(1)^')!' < $p/index.md
# cat $p/index.md | sed '1s!.*![&]('^$l(2)^') ('^$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.
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.
}

0
apps/blagh/atom.tpl Normal file → Executable file
View File

0
apps/blagh/jsonfeed.tpl Normal file → Executable file
View File

0
apps/blagh/new_post.tpl Normal file → Executable file
View File

0
apps/blagh/rss20.tpl Normal file → Executable file
View File

0
apps/duckduckgo/HOWTO Normal file → Executable file
View File

0
apps/duckduckgo/footer.inc.sample Normal file → Executable file
View File