* 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.master
parent
469d09d4c1
commit
b31e8c0826
|
@ -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}));
|
||||
}
|
||||
} # }}}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,25 +1,44 @@
|
|||
<entry>
|
||||
<title><TMPL_VAR TITLE></title>
|
||||
<TMPL_IF NAME="AUTHOR">
|
||||
<author><TMPL_VAR AUTHOR ESCAPE=HTML></author>
|
||||
<TMPL_ELSE>
|
||||
</TMPL_IF>
|
||||
<id><TMPL_VAR URL></id>
|
||||
<link href="<TMPL_VAR PERMALINK>"/>
|
||||
<TMPL_IF NAME="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>
|
||||
<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>
|
||||
|
|
Loading…
Reference in New Issue