aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--IkiWiki/Plugin/meta.pm21
-rw-r--r--debian/changelog8
-rw-r--r--doc/plugins/meta.mdwn4
-rw-r--r--doc/tips/integrated_issue_tracking_with_ikiwiki.mdwn6
-rw-r--r--templates/atomitem.tmpl43
5 files changed, 64 insertions, 18 deletions
diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm
index 987262a48..88c942fa4 100644
--- a/IkiWiki/Plugin/meta.pm
+++ b/IkiWiki/Plugin/meta.pm
@@ -43,6 +43,23 @@ sub scrub ($) { #{{{
}
} #}}}
+sub htmlize ($$$) { #{{{
+ my $page = shift;
+ my $destpage = shift;
+ my $text = shift;
+
+ $text=IkiWiki::htmlize($page, pagetype($pagesources{$page}),
+ IkiWiki::linkify($page, $destpage,
+ IkiWiki::preprocess($page, $destpage, $text)));
+
+ # hack to get rid of enclosing junk added by markdown
+ $text=~s!^<p>!!;
+ $text=~s!</p>$!!;
+ chomp $text;
+
+ return $text;
+}
+
sub preprocess (@) { #{{{
return "" unless @_;
my %params=@_;
@@ -193,12 +210,12 @@ sub pagetemplate (@) { #{{{
if (exists $license{$page} && $template->query(name => "license") &&
($page eq $destpage || ! exists $license{$destpage} ||
$license{$page} ne $license{$destpage})) {
- $template->param(license => IkiWiki::linkify($page, $destpage, $license{$page}));
+ $template->param(license => htmlize($page, $destpage, $license{$page}));
}
if (exists $copyright{$page} && $template->query(name => "copyright") &&
($page eq $destpage || ! exists $copyright{$destpage} ||
$copyright{$page} ne $copyright{$destpage})) {
- $template->param(copyright => IkiWiki::linkify($page, $destpage, $copyright{$page}));
+ $template->param(copyright => htmlize($page, $destpage, $copyright{$page}));
}
} # }}}
diff --git a/debian/changelog b/debian/changelog
index 51dcaf8af..d5117d867 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+ikiwiki (2.20) UNRELEASED; urgency=low
+
+ * inline: Add copyright/license info on a per-post basis to atom
+ feeds if available. (rss doesn't allow such info on a per-post basis)
+ * meta: Allow copyright/license metadata to contain arbitrary markup.
+
+ -- Joey Hess <joeyh@debian.org> Wed, 09 Jan 2008 00:34:46 -0500
+
ikiwiki (2.19) unstable; urgency=low
* Only try postsignin if no other action matched. Fixes a bug where the
diff --git a/doc/plugins/meta.mdwn b/doc/plugins/meta.mdwn
index 479d62c43..ec4348e41 100644
--- a/doc/plugins/meta.mdwn
+++ b/doc/plugins/meta.mdwn
@@ -27,12 +27,12 @@ Supported fields:
* license
Specifies a license for the page, for example, "GPL". Can contain
- WikiLinks.
+ WikiLinks and arbitrary markup.
* copyright
Specifies the copyright of the page, for example, "Copyright 2007 by
- Joey Hess". Can contain WikiLinks.
+ Joey Hess". Can contain WikiLinks and arbitrary markup.
* author
diff --git a/doc/tips/integrated_issue_tracking_with_ikiwiki.mdwn b/doc/tips/integrated_issue_tracking_with_ikiwiki.mdwn
index fcec5cb56..332b86bac 100644
--- a/doc/tips/integrated_issue_tracking_with_ikiwiki.mdwn
+++ b/doc/tips/integrated_issue_tracking_with_ikiwiki.mdwn
@@ -1,12 +1,14 @@
[[meta title="Integrated issue tracking with Ikiwiki"]]
-By Joey Hess, LinuxWorld.com
+[[meta author="Joey Hess, LinuxWorld.com"]]
-[[template id=note text="""
+[[meta copyright="""
+© 2007 Joey Hess <joeyh@ikiwiki.info>, LinuxWorld.com
[First published](http://www.linuxworld.com/news/2007/040607-integrated-issue-tracking-ikiwiki.html)
on [LinuxWorld.com](http://www.linuxworld.com/), a publication of Network
World Inc., 118 Turnpike Rd., Southboro, MA 01772.
"""]]
+[[meta license="[[GPL|freesoftware]]"]]
Wikis are not just for encyclopedias and websites anymore. You can use
Ikiwiki in combination with your revision control system to handle issue
diff --git a/templates/atomitem.tmpl b/templates/atomitem.tmpl
index 4dc2d07d6..1b1d686dd 100644
--- a/templates/atomitem.tmpl
+++ b/templates/atomitem.tmpl
@@ -1,25 +1,44 @@
<entry>
<title><TMPL_VAR TITLE></title>
+ <id><TMPL_VAR URL></id>
+ <link href="<TMPL_VAR PERMALINK>"/>
<TMPL_IF NAME="AUTHOR">
- <author><TMPL_VAR AUTHOR ESCAPE=HTML></author>
+ <author><name><TMPL_VAR AUTHOR ESCAPE=HTML></name></author>
+ </TMPL_IF>
+ <TMPL_IF NAME="COPYRIGHT">
+ <rights type="xhtml" xml:lang="en">
+ <div xmlns="http://www.w3.org/1999/xhtml">
+ <TMPL_IF NAME="LICENSE">
+ <TMPL_VAR LICENSE>
+ <TMPL_VAR COPYRIGHT>
+ <TMPL_ELSE>
+ <TMPL_VAR COPYRIGHT>
+ </TMPL_IF>
+ </div>
+ </rights>
<TMPL_ELSE>
+ <TMPL_IF NAME="LICENSE">
+ <rights type="xhtml" xml:lang="en">
+ <div xmlns="http://www.w3.org/1999/xhtml">
+ <TMPL_VAR LICENSE>
+ </div>
+ </rights>
+ </TMPL_IF>
</TMPL_IF>
- <id><TMPL_VAR URL></id>
- <link href="<TMPL_VAR PERMALINK>"/>
<TMPL_IF NAME="CATEGORIES">
- <TMPL_LOOP NAME="CATEGORIES">
- <category term="<TMPL_VAR CATEGORY>" />
- </TMPL_LOOP>
+ <TMPL_LOOP NAME="CATEGORIES">
+ <category term="<TMPL_VAR CATEGORY>" />
+ </TMPL_LOOP>
</TMPL_IF>
<updated><TMPL_VAR MDATE_3339></updated>
<published><TMPL_VAR CDATE_3339></published>
<TMPL_IF NAME="ENCLOSURE">
- <link rel="enclosure" type="<TMPL_VAR TYPE>" href="<TMPL_VAR ENCLOSURE>" length="<TMPL_VAR LENGTH>" />
+ <link rel="enclosure" type="<TMPL_VAR TYPE>" href="<TMPL_VAR ENCLOSURE>" length="<TMPL_VAR LENGTH>" />
<TMPL_ELSE>
- <content type="xhtml" xml:lang="en">
- <div xmlns="http://www.w3.org/1999/xhtml">
- <TMPL_VAR CONTENT>
- </div>
- </content>
+ <content type="xhtml" xml:lang="en">
+ <div xmlns="http://www.w3.org/1999/xhtml">
+ <TMPL_VAR CONTENT>
+ </div>
+ </content>
</TMPL_IF>
</entry>