quotes and such can be represented in title tags.
* Depend and build-depend on HTML::Parser for HTML::Entities which is used
for the above.
* Make --rebuild also cause --aggregate to re-download and write aggregated
pages.
* Avoid outputting duplicate meta info.
* Include title metadata on aggregated posts for capitalised and un-munged
titles.
die $@ if $@;
foreach my $feed (values %feeds) {
die $@ if $@;
foreach my $feed (values %feeds) {
- next unless time - $feed->{lastupdate} >= $feed->{updateinterval};
+ next unless $IkiWiki::config{rebuild} ||
+ time - $feed->{lastupdate} >= $feed->{updateinterval};
$feed->{lastupdate}=time;
$feed->{newposts}=0;
$IkiWiki::forcerebuild{$feed->{sourcepage}}=1;
$feed->{lastupdate}=time;
$feed->{newposts}=0;
$IkiWiki::forcerebuild{$feed->{sourcepage}}=1;
eval q{use Digest::MD5 'md5_hex'};
require Encode;
my $digest=md5_hex(Encode::encode_utf8($params{content}));
eval q{use Digest::MD5 'md5_hex'};
require Encode;
my $digest=md5_hex(Encode::encode_utf8($params{content}));
- return unless ! exists $guid->{md5} || $guid->{md5} ne $digest;
+ return unless ! exists $guid->{md5} || $guid->{md5} ne $digest || $IkiWiki::config{rebuild};
$guid->{md5}=$digest;
# Create the page.
$guid->{md5}=$digest;
# Create the page.
my $content=$params{content};
$params{content}=~s/(?<!\\)\[\[/\\\[\[/g; # escape accidental wikilinks
# and preprocessor stuff
my $content=$params{content};
$params{content}=~s/(?<!\\)\[\[/\\\[\[/g; # escape accidental wikilinks
# and preprocessor stuff
+ $template->param(title => $params{title})
+ if defined $params{title} && length($params{title});
$template->param(content => $params{content});
$template->param(url => $feed->{url});
$template->param(name => $feed->{name});
$template->param(content => $params{content});
$template->param(url => $feed->{url});
$template->param(name => $feed->{name});
sub import { #{{{
IkiWiki::hook(type => "preprocess", id => "meta",
call => \&preprocess);
sub import { #{{{
IkiWiki::hook(type => "preprocess", id => "meta",
call => \&preprocess);
+ IkiWiki::hook(type => "filter", id => "meta",
+ call => \&filter);
IkiWiki::hook(type => "pagetemplate", id => "meta",
call => \&pagetemplate);
} # }}}
IkiWiki::hook(type => "pagetemplate", id => "meta",
call => \&pagetemplate);
} # }}}
+sub filter (@) { #{{{
+ my %params=@_;
+
+ $meta{$params{page}}='';
+
+ return $params{content};
+} # }}}
+
sub preprocess (@) { #{{{
if (! @_) {
return "";
sub preprocess (@) { #{{{
if (! @_) {
return "";
delete $params{page};
delete $params{destpage};
delete $params{page};
delete $params{destpage};
- eval q{use CGI 'escapeHTML'};
+ eval q{use HTML::Entities};
+ # Always dencode, even if encoding later, since it might not be
+ # fully encoded.
+ $value=decode_entities($value);
if ($key eq 'link') {
if (%params) {
if ($key eq 'link') {
if (%params) {
- $meta{$page}='' unless exists $meta{$page};
- $meta{$page}.="<link href=\"".escapeHTML($value)."\" ".
- join(" ", map { escapeHTML("$_=\"$params{$_}\"") } keys %params).
+ $meta{$page}.="<link href=\"".encode_entities($value)."\" ".
+ join(" ", map { encode_entities($_)."=\"".encode_entities(decode_entities($params{$_}))."\"" } keys %params).
}
}
elsif ($key eq 'title') {
}
}
elsif ($key eq 'title') {
- $title{$page}=escapeHTML($value);
- $meta{$page}='' unless exists $meta{$page};
- $meta{$page}.="<meta name=\"".escapeHTML($key)."\" content=\"".escapeHTML($value)."\" />\n";
+ $meta{$page}.="<meta name=\"".encode_entities($key).
+ "\" content=\"".encode_entities($value)."\" />\n";
--wrappers to do that.
* Add %IkiWiki::forcerebuild to provide a way for plugins like aggregate
to update pages that haven't changed on disk.
--wrappers to do that.
* Add %IkiWiki::forcerebuild to provide a way for plugins like aggregate
to update pages that haven't changed on disk.
-
- -- Joey Hess <joeyh@debian.org> Sat, 29 Jul 2006 20:10:51 -0400
+ * Change meta tags to use html entity-escaped text for values, so that
+ quotes and such can be represented in title tags.
+ * Depend and build-depend on HTML::Parser for HTML::Entities which is used
+ for the above.
+ * Make --rebuild also cause --aggregate to re-download and write aggregated
+ pages.
+ * Avoid outputting duplicate meta info.
+ * Include title metadata on aggregated posts for capitalised and un-munged
+ titles.
+
+ -- Joey Hess <joeyh@debian.org> Sun, 30 Jul 2006 18:17:28 -0400
ikiwiki (1.12) unstable; urgency=low
ikiwiki (1.12) unstable; urgency=low
Section: web
Priority: optional
Build-Depends: perl, debhelper (>= 5)
Section: web
Priority: optional
Build-Depends: perl, debhelper (>= 5)
-Build-Depends-Indep: dpkg-dev (>= 1.9.0), markdown, libhtml-template-perl, libhtml-scrubber-perl, wdg-html-validator, libtext-wikiformat-perl
+Build-Depends-Indep: dpkg-dev (>= 1.9.0), markdown, libhtml-template-perl, libhtml-scrubber-perl, wdg-html-validator, libtext-wikiformat-perl, libhtml-parser-perl
Maintainer: Joey Hess <joeyh@debian.org>
Standards-Version: 3.7.2
Package: ikiwiki
Architecture: all
Maintainer: Joey Hess <joeyh@debian.org>
Standards-Version: 3.7.2
Package: ikiwiki
Architecture: all
-Depends: ${perl:Depends}, libxml-simple-perl, markdown, libtimedate-perl, libhtml-template-perl, libhtml-scrubber-perl, libcgi-formbuilder-perl (>= 3.02.02), libtime-duration-perl, libcgi-session-perl, libmail-sendmail-perl, gcc | c-compiler, libc6-dev | libc-dev
+Depends: ${perl:Depends}, libxml-simple-perl, markdown, libtimedate-perl, libhtml-template-perl, libhtml-scrubber-perl, libcgi-formbuilder-perl (>= 3.02.02), libtime-duration-perl, libcgi-session-perl, libmail-sendmail-perl, gcc | c-compiler, libc6-dev | libc-dev, libhtml-parser-perl
Recommends: subversion | git-core, hyperestraier
Recommends: subversion | git-core, hyperestraier
-Suggests: viewcvs, librpc-xml-perl, libtext-wikiformat-perl, polygen, tidy, libxml-feed-perl, libhtml-parser-perl
+Suggests: viewcvs, librpc-xml-perl, libtext-wikiformat-perl, polygen, tidy, libxml-feed-perl
Description: a wiki compiler
ikiwiki converts a directory full of wiki pages into html pages suitable
for publishing on a website. Unlike many wikis, ikiwiki does not have its
Description: a wiki compiler
ikiwiki converts a directory full of wiki pages into html pages suitable
for publishing on a website. Unlike many wikis, ikiwiki does not have its
## setup
Make sure that you have the [[html]] plugin enabled, as the created pages are
## setup
Make sure that you have the [[html]] plugin enabled, as the created pages are
-in html format. The [[tag]] plugin is also recommended.
+in html format. The [[meta]] and [[tag]] plugins are also recommended.
You will need to run ikiwiki periodically from a cron job, passing it the
--aggregate parameter, to make it check for new posts. Here's an example
You will need to run ikiwiki periodically from a cron job, passing it the
--aggregate parameter, to make it check for new posts. Here's an example
the metadata will be written to the generated html page as a <meta>
header.
the metadata will be written to the generated html page as a <meta>
header.
+The field value is treated as HTML entity-escaped text, so you can include
+a quote in the text by writing `"` and so on.
+
This plugin is included in ikiwiki, but it is not enabled by default. If
it is enabled, the title of this page will say it is.
[[meta title="meta plugin (enabled)"]]
This plugin is included in ikiwiki, but it is not enabled by default. If
it is enabled, the title of this page will say it is.
[[meta title="meta plugin (enabled)"]]
If the aggregate plugin is enabled, this makes ikiwiki poll configured
feeds and save new posts to the srcdir.
If the aggregate plugin is enabled, this makes ikiwiki poll configured
feeds and save new posts to the srcdir.
+ Note that to rebuild previously aggregated posts, use the --rebuild option
+ along with this one. --rebuild will also force feeds to be polled even if
+ they were polled recently.
+
# CONFIG OPTIONS
These options configure the wiki. Note that plugins can add additional
# CONFIG OPTIONS
These options configure the wiki. Note that plugins can add additional
<TMPL_LOOP NAME="TAGS">
[[tag <TMPL_VAR TAG>]]
</TMPL_LOOP>
<TMPL_LOOP NAME="TAGS">
[[tag <TMPL_VAR TAG>]]
</TMPL_LOOP>
+<TMPL_IF NAME="TITLE">
+[[meta title="<TMPL_VAR NAME="TITLE" ESCAPE=HTML>"]]
+</TMPL_IF>