aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--IkiWiki/Plugin/meta.pm15
-rw-r--r--debian/changelog6
-rw-r--r--doc/plugins/meta.mdwn8
-rw-r--r--po/ikiwiki.pot4
-rw-r--r--templates/inlinepage.tmpl14
-rw-r--r--templates/page.tmpl14
6 files changed, 57 insertions, 4 deletions
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}.='<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");
} # }}}
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 <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
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 <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 ""
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:
</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>
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:
</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>