From 831800b842f178994252970480a806884d2a1d76 Mon Sep 17 00:00:00 2001
From: Andreas Gohr <andi@splitbrain.org>
Date: Sun, 3 Sep 2006 18:12:04 +0200
Subject: [PATCH] keyword meta header

The <meta name

darcs-hash:20060903161204-7ad00-61c823d3806e6fdc2ffa3d4978a90dc9953ef9ce.gz
---
 inc/template.php | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/inc/template.php b/inc/template.php
index d30500e94..81913a8e7 100644
--- a/inc/template.php
+++ b/inc/template.php
@@ -187,7 +187,6 @@ function tpl_metaheaders($alt=true){
   // setup robot tags apropriate for different modes
   if( ($ACT=='show' || $ACT=='export_xhtml') && !$REV){
     if($INFO['exists']){
-      ptln('<meta name="date" content="'.date('Y-m-d\TH:i:sO',$INFO['lastmod']).'" />',$it);
       //delay indexing:
       if((time() - $INFO['lastmod']) >= $conf['indexdelay']){
         ptln('<meta name="robots" content="index,follow" />',$it);
@@ -203,6 +202,23 @@ function tpl_metaheaders($alt=true){
     ptln('<meta name="robots" content="noindex,nofollow" />',$it);
   }
 
+  // set metadata
+  if($ACT == 'show' || $ACT=='export_xhtml'){
+    // date of modification
+    if($REV){
+      ptln('<meta name="date" content="'.date('Y-m-d\TH:i:sO',$REV).'" />',$it);
+    }else{
+      ptln('<meta name="date" content="'.date('Y-m-d\TH:i:sO',$INFO['lastmod']).'" />',$it);
+    }
+
+    // keywords (explicit or implicit)
+    if($INFO['meta']['subject']){
+      ptln('<meta name="keywords" content="'.hsc(join(',',$INFO['meta']['subject'])).' />',$it);
+    }else{
+      ptln('<meta name="keywords" content="'.str_replace(':',',',$ID).'" />',$it);
+    }
+  }
+
   // load stylesheets
   ptln('<link rel="stylesheet" media="screen" type="text/css" href="'.DOKU_BASE.'lib/exe/css.php" />',$it);
   ptln('<link rel="stylesheet" media="print" type="text/css" href="'.DOKU_BASE.'lib/exe/css.php?print=1" />',$it);
-- 
GitLab