From 095f3bf1240f9bb815ebde74fe8246c8615dbcea Mon Sep 17 00:00:00 2001 From: Uriel Date: Mon, 21 Jun 2010 23:41:18 +0000 Subject: [PATCH] When showing a _header.md file for a dir listing, try to extract the page title from it. --- bin/corehandlers.rc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/corehandlers.rc b/bin/corehandlers.rc index 88f9189..e0b2b37 100644 --- a/bin/corehandlers.rc +++ b/bin/corehandlers.rc @@ -121,8 +121,13 @@ fn setup_handlers { # Dir listing if not if(~ $local_path */index) { handler_body_main=(dir_listing_handler $req_path) - if(test -f $sitedir$req_path'_header.md') - ll_add handlers_body_head md_handler $sitedir$req_path'_header.md' + if(test -f $sitedir$req_path'_header.md') { + t=`{get_file_title $sitedir$req_path'_header.md'} + if(! ~ $"t '') + pageTitle=$t + + ll_add handlers_body_head md_handler $sitedir$req_path'_header.md' + } if(test -f $sitedir$req_path'_footer.md') ll_add handlers_body_foot md_handler $sitedir$req_path'_footer.md' }