aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-01-09 01:05:54 -0500
committerJoey Hess <joey@kodama.kitenet.net>2008-01-09 01:05:54 -0500
commitb31e8c08260b0da95014caea078f3155d4707e28 (patch)
treeaae1a8bbfe2b6e57ca02f741fec18ef97ba7f0e3 /IkiWiki
parent469d09d4c15cf7431f65f19cc37d9fc174248a17 (diff)
downloadikiwiki-b31e8c08260b0da95014caea078f3155d4707e28.tar
ikiwiki-b31e8c08260b0da95014caea078f3155d4707e28.tar.gz
* 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.
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/meta.pm21
1 files changed, 19 insertions, 2 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}));
}
} # }}}