diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm index fd21432fa..a4dd541f9 100644 --- a/IkiWiki/Plugin/meta.pm +++ b/IkiWiki/Plugin/meta.pm @@ -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}.='\n"; } + elsif ($key eq 'license') { + $meta{$page}.="\n"; + $license{$page}=IkiWiki::linkify($page, $destpage, $value); + } + elsif ($key eq 'copyright') { + $meta{$page}.="\n"; + $copyright{$page}=IkiWiki::linkify($page, $destpage, $value); + } else { $meta{$page}.=scrub("\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"); } # }}} diff --git a/debian/changelog b/debian/changelog index 749055e73..66eb8af27 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Thu, 13 Sep 2007 18:07:51 -0400 + -- Joey Hess Fri, 14 Sep 2007 13:05:22 -0400 ikiwiki (2.7) unstable; urgency=low diff --git a/doc/plugins/meta.mdwn b/doc/plugins/meta.mdwn index 78a8c9339..093766708 100644 --- a/doc/plugins/meta.mdwn +++ b/doc/plugins/meta.mdwn @@ -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 diff --git a/po/ikiwiki.pot b/po/ikiwiki.pot index 381009ae2..baa053426 100644 --- a/po/ikiwiki.pot +++ b/po/ikiwiki.pot @@ -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 \n" "Language-Team: LANGUAGE \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 "" diff --git a/templates/inlinepage.tmpl b/templates/inlinepage.tmpl index e1943baec..17043b608 100644 --- a/templates/inlinepage.tmpl +++ b/templates/inlinepage.tmpl @@ -30,6 +30,20 @@ Tags: + + + + + +
+ +License: +
+
+
    diff --git a/templates/page.tmpl b/templates/page.tmpl index fd44a53be..3281ac701 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -88,6 +88,20 @@ Links:
+ + + + + +
+ +License: +
+
+
Last edited