$feed->{name}=$name;
$feed->{sourcepage}=$params{page};
$feed->{url}=$params{url};
- my $dir=exists $params{dir} ? $params{dir} : IkiWiki::titlepage($params{name});
+ my $dir=exists $params{dir} ? $params{dir} : "feed/".IkiWiki::titlepage($params{name});
$dir=~s/^\/+//;
($dir)=$dir=~/$IkiWiki::config{wiki_file_regexp}/;
$feed->{dir}=$dir;
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->{newposts}++;
# assign it an unused page
- my $page=$feed->{dir}."/".IkiWiki::titlepage($params{title});
+ my $page=IkiWiki::titlepage($params{title});
+ $page=~s!([/])!"__".ord($1)."__"!eg; # escape slashes in title
+ $page=$feed->{dir}."/".$page;
$page=lc($page);
($page)=$page=~/$IkiWiki::config{wiki_file_regexp}/;
if (! defined $page || ! length $page) {
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.
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});