* Add support for links of the form [[../foo]], this links to the page
* Fix code to make absolute urls for rss feeds, was missing some urls. * Fix double-escaping of html entities in titles etc in rss feeds that occured if escaped characters were present in the page filename.master
parent
a00bc110b1
commit
31d0021e9c
10
IkiWiki.pm
10
IkiWiki.pm
|
@ -327,10 +327,18 @@ sub isinlinableimage ($) { #{{{
|
||||||
$file=~/\.(png|gif|jpg|jpeg)$/i;
|
$file=~/\.(png|gif|jpg|jpeg)$/i;
|
||||||
} #}}}
|
} #}}}
|
||||||
|
|
||||||
sub pagetitle ($) { #{{{
|
sub pagetitle ($;$) { #{{{
|
||||||
my $page=shift;
|
my $page=shift;
|
||||||
|
my $unescaped=shift;
|
||||||
|
|
||||||
|
if ($unescaped) {
|
||||||
|
$page=~s/__(\d+)__/chr($1)/eg;
|
||||||
|
}
|
||||||
|
else {
|
||||||
$page=~s/__(\d+)__/&#$1;/g;
|
$page=~s/__(\d+)__/&#$1;/g;
|
||||||
|
}
|
||||||
$page=~y/_/ /;
|
$page=~y/_/ /;
|
||||||
|
|
||||||
return $page;
|
return $page;
|
||||||
} #}}}
|
} #}}}
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,6 @@ sub checkconfig () { #{{{
|
||||||
error("Must specify url to wiki with --url when using --rss or --atom");
|
error("Must specify url to wiki with --url when using --rss or --atom");
|
||||||
}
|
}
|
||||||
if ($config{rss}) {
|
if ($config{rss}) {
|
||||||
print STDERR "!!\n";
|
|
||||||
push @{$config{wiki_file_prune_regexps}}, qr/\.rss$/;
|
push @{$config{wiki_file_prune_regexps}}, qr/\.rss$/;
|
||||||
}
|
}
|
||||||
if ($config{atom}) {
|
if ($config{atom}) {
|
||||||
|
@ -265,8 +264,8 @@ sub absolute_urls ($$) { #{{{
|
||||||
$url=~s/[^\/]+$//;
|
$url=~s/[^\/]+$//;
|
||||||
|
|
||||||
$content=~s/(<a(?:\s+(?:class|id)="?\w+"?)?)\s+href="(#[^"]+)"/$1 href="$baseurl$2"/ig;
|
$content=~s/(<a(?:\s+(?:class|id)="?\w+"?)?)\s+href="(#[^"]+)"/$1 href="$baseurl$2"/ig;
|
||||||
$content=~s/(<a(?:\s+(?:class|id)="?\w+"?)?)\s+href="(?![^:]+:\/\/)([^"]+)"/$1 href="$url$2"/ig;
|
$content=~s/(<a(?:\s+(?:class|id)="?\w+"?)?)\s+href="(?!\w+:\/\/)([^"]+)"/$1 href="$url$2"/ig;
|
||||||
$content=~s/(<img(?:\s+(?:class|id)="?\w+"?)?)\s+src="(?![^:]+:\/\/)([^"]+)"/$1 src="$url$2"/ig;
|
$content=~s/(<img(?:\s+(?:class|id)="?\w+"?)?)\s+src="(?!\w+:\/\/)([^"]+)"/$1 src="$url$2"/ig;
|
||||||
return $content;
|
return $content;
|
||||||
} #}}}
|
} #}}}
|
||||||
|
|
||||||
|
@ -300,7 +299,7 @@ sub genfeed ($$$$@) { #{{{
|
||||||
my $pcontent = absolute_urls(get_inline_content($p, $page), $url);
|
my $pcontent = absolute_urls(get_inline_content($p, $page), $url);
|
||||||
|
|
||||||
$itemtemplate->param(
|
$itemtemplate->param(
|
||||||
title => pagetitle(basename($p)),
|
title => pagetitle(basename($p), 1),
|
||||||
url => $u,
|
url => $u,
|
||||||
permalink => $u,
|
permalink => $u,
|
||||||
date_822 => date_822($pagectime{$p}),
|
date_822 => date_822($pagectime{$p}),
|
||||||
|
@ -344,7 +343,7 @@ sub genfeed ($$$$@) { #{{{
|
||||||
|
|
||||||
my $template=template($feedtype."page.tmpl", blind_cache => 1);
|
my $template=template($feedtype."page.tmpl", blind_cache => 1);
|
||||||
$template->param(
|
$template->param(
|
||||||
title => $page ne "index" ? pagetitle($page) : $config{wikiname},
|
title => $page ne "index" ? pagetitle($page, 1) : $config{wikiname},
|
||||||
wikiname => $config{wikiname},
|
wikiname => $config{wikiname},
|
||||||
pageurl => $url,
|
pageurl => $url,
|
||||||
content => $content,
|
content => $content,
|
||||||
|
@ -384,7 +383,7 @@ sub pingurl (@) { #{{{
|
||||||
IkiWiki::unlockwiki();
|
IkiWiki::unlockwiki();
|
||||||
|
|
||||||
foreach my $page (keys %toping) {
|
foreach my $page (keys %toping) {
|
||||||
my $title=pagetitle(basename($page));
|
my $title=pagetitle(basename($page), 0);
|
||||||
my $url="$config{url}/".htmlpage($page);
|
my $url="$config{url}/".htmlpage($page);
|
||||||
foreach my $pingurl (@{$config{pingurl}}) {
|
foreach my $pingurl (@{$config{pingurl}}) {
|
||||||
debug("Pinging $pingurl for $page");
|
debug("Pinging $pingurl for $page");
|
||||||
|
|
|
@ -21,8 +21,11 @@ ikiwiki (1.36) UNRELEASED; urgency=low
|
||||||
* Add support for links of the form [[../foo]], this links to the page
|
* Add support for links of the form [[../foo]], this links to the page
|
||||||
foo a level higher in the directory hierarchy than the one it would link
|
foo a level higher in the directory hierarchy than the one it would link
|
||||||
to by default.
|
to by default.
|
||||||
|
* Fix code to make absolute urls for rss feeds, was missing some urls.
|
||||||
|
* Fix double-escaping of html entities in titles etc in rss feeds
|
||||||
|
that occured if escaped characters were present in the page filename.
|
||||||
|
|
||||||
-- Joey Hess <joeyh@debian.org> Thu, 21 Dec 2006 15:10:03 -0500
|
-- Joey Hess <joeyh@debian.org> Thu, 21 Dec 2006 16:28:54 -0500
|
||||||
|
|
||||||
ikiwiki (1.35) unstable; urgency=low
|
ikiwiki (1.35) unstable; urgency=low
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue