* meta: Support license and copyright information. The information will
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Fri, 14 Sep 2007 18:11:10 +0000 (18:11 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Fri, 14 Sep 2007 18:11:10 +0000 (18:11 +0000)
  be shown in the page footer. HTML will also be inserted that should
  support the rel=license microformat as well as the HTML spec's
  rel=copyright.

IkiWiki/Plugin/meta.pm
debian/changelog
doc/plugins/meta.mdwn
po/ikiwiki.pot
templates/inlinepage.tmpl
templates/page.tmpl

index fd21432fad09d790c6478b34b6004e0b1b96ff15..a4dd541f982eda7ef884395692f55a48baa85e83 100644 (file)
@@ -11,6 +11,8 @@ my %title;
 my %permalink;
 my %author;
 my %authorurl;
+my %license;
+my %copyright;
 
 sub import { #{{{
        hook(type => "preprocess", id => "meta", call => \&preprocess, scan => 1);
@@ -45,6 +47,7 @@ sub preprocess (@) { #{{{
        delete $params{$key};
        my $page=$params{page};
        delete $params{page};
+       my $destpage=$params{destpage};
        delete $params{destpage};
        delete $params{preview};
 
@@ -100,6 +103,14 @@ sub preprocess (@) { #{{{
                $meta{$page}.='<link href="'.encode_entities($value).
                        "\" rel=\"openid.delegate\" />\n";
        }
+       elsif ($key eq 'license') {
+               $meta{$page}.="<link rel=\"license\" href=\"#page_license\" />\n";
+               $license{$page}=IkiWiki::linkify($page, $destpage, $value);
+       }
+       elsif ($key eq 'copyright') {
+               $meta{$page}.="<link rel=\"copyright\" href=\"#page_copyright\" />\n";
+               $copyright{$page}=IkiWiki::linkify($page, $destpage, $value);
+       }
        else {
                $meta{$page}.=scrub("<meta name=\"".encode_entities($key).
                        "\" content=\"".encode_entities($value)."\" />\n");
@@ -131,6 +142,10 @@ sub pagetemplate (@) { #{{{
                if exists $author{$page} && $template->query(name => "author");
        $template->param(authorurl => $authorurl{$page})
                if exists $authorurl{$page} && $template->query(name => "authorurl");
+       $template->param(license => $license{$page})
+               if exists $license{$page} && $template->query(name => "license");
+       $template->param(copyright => $copyright{$page})
+               if exists $copyright{$page} && $template->query(name => "copyright");
        
 } # }}}
 
index 749055e730d625b531d70199d06b6acb78a7e9a8..66eb8af27c5dee1a7a832f0afabe8fbf0974ce60 100644 (file)
@@ -4,8 +4,12 @@ ikiwiki (2.8) UNRELEASED; urgency=low
     format. Included many details not previously listed in the old file.
   * inline: add feedonly option, set feedonly=yes to get only the feed button
     but not inline the pages.
+  * meta: Support license and copyright information. The information will
+    be shown in the page footer. HTML will also be inserted that should
+    support the rel=license microformat as well as the HTML spec's
+    rel=copyright.
 
- -- Joey Hess <joeyh@debian.org>  Thu, 13 Sep 2007 18:07:51 -0400
+ -- Joey Hess <joeyh@debian.org>  Fri, 14 Sep 2007 13:05:22 -0400
 
 ikiwiki (2.7) unstable; urgency=low
 
index 78a8c9339bdb225c65d1977d47b7d0e1063b7121..0937667089d930715fe41e38e4d8653ccd44482d 100644 (file)
@@ -41,7 +41,13 @@ You can use any field names you like, but here are some predefined ones:
 
 * license
 
-  Specifies a copyright license for the page, for example, "GPL".
+  Specifies a license for the page, for example, "GPL". Can contain
+  WikiLinks.
+
+* copyright
+
+  Specifies the copyright of the page, for example, "Copyright 2007 by
+  Joey Hess". Can contain WikiLinks.
 
 * author
 
index 381009ae21d71e9a17e2899a70fda7676085d201..baa053426971331cded39023998fe22badc2461a 100644 (file)
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2007-09-13 18:22-0400\n"
+"POT-Creation-Date: 2007-09-14 14:10-0400\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -213,7 +213,7 @@ msgstr ""
 msgid "failed to load Markdown.pm perl module (%s) or /usr/bin/markdown (%s)"
 msgstr ""
 
-#: ../IkiWiki/Plugin/meta.pm:88
+#: ../IkiWiki/Plugin/meta.pm:92
 msgid "stylesheet not found"
 msgstr ""
 
index e1943baec13fe3e7ac72b0971d52d6284e98bdf7..17043b6083f120690bc8a570fd93a4df6b1f0e15 100644 (file)
@@ -30,6 +30,20 @@ Tags:
 </span>
 </TMPL_IF>
 
+<TMPL_IF COPYRIGHT>
+<div class="copyright">
+<a name="page_copyright"></a>
+<TMPL_VAR COPYRIGHT>
+</div>
+</TMPL_IF>
+
+<TMPL_IF LICENSE>
+<div class="license">
+<a name="page_license"></a>
+License: <TMPL_VAR LICENSE>
+</div>
+</TMPL_IF>
+
 <TMPL_IF NAME="HAVE_ACTIONS">
 <div class="actions">
 <ul>
index fd44a53be0a7e1e1a81d0950bfde16f79ef1a2b9..3281ac7017986435874d066f9066efdf97d1ae3f 100644 (file)
@@ -88,6 +88,20 @@ Links:
 </div>
 </TMPL_IF>
 
+<TMPL_IF COPYRIGHT>
+<div class="copyright">
+<a name="page_copyright"></a>
+<TMPL_VAR COPYRIGHT>
+</div>
+</TMPL_IF>
+
+<TMPL_IF LICENSE>
+<div class="license">
+<a name="page_license"></a>
+License: <TMPL_VAR LICENSE>
+</div>
+</TMPL_IF>
+
 <div class="pagedate">
 Last edited <TMPL_VAR NAME=MTIME>
 </div>