changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > werc / changeset: When showing a _header.md file for a dir listing, try to extract the page title from it.

changeset 641: fd97c22d3538
parent 638: 246f5fab8f92
child 642: a63af921ec7d
author: Uriel <u@berlinblue.org>
date: Mon, 21 Jun 2010 23:41:18 +0000
files: bin/corehandlers.rc
description: When showing a _header.md file for a dir listing, try to extract the page title from it.
     1.1--- a/bin/corehandlers.rc	Fri Jun 11 04:28:39 2010 +0000
     1.2+++ b/bin/corehandlers.rc	Mon Jun 21 23:41:18 2010 +0000
     1.3@@ -121,8 +121,13 @@
     1.4     # Dir listing
     1.5     if not if(~ $local_path */index) {
     1.6         handler_body_main=(dir_listing_handler $req_path)
     1.7-        if(test -f $sitedir$req_path'_header.md')
     1.8-            ll_add handlers_body_head md_handler $sitedir$req_path'_header.md'            
     1.9+        if(test -f $sitedir$req_path'_header.md') {
    1.10+            t=`{get_file_title $sitedir$req_path'_header.md'}
    1.11+            if(! ~ $"t '')
    1.12+                pageTitle=$t
    1.13+
    1.14+            ll_add handlers_body_head md_handler $sitedir$req_path'_header.md' 
    1.15+        }
    1.16         if(test -f $sitedir$req_path'_footer.md')
    1.17             ll_add handlers_body_foot md_handler $sitedir$req_path'_footer.md'            
    1.18     }