shithub: werc

Download patch

ref: de5e378e7404e111ec4a91bec7aba6c32b11b7c3
parent: 7780831fd34d55aff389d94f2ed53b576076c7fd
author: Uriel <u@berlinblue.org>
date: Mon Jun 21 19:41:18 EDT 2010

When showing a _header.md file for a dir listing, try to extract the page title from it.

--- a/bin/corehandlers.rc
+++ b/bin/corehandlers.rc
@@ -121,8 +121,13 @@
     # 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'            
     }