IkiWiki::Render: split out backlink_pages() function from backlinks()
This separates style from content - backlinks() performs lossy transformations on the page names to get it in the form that the page template wants.master
parent
2b0c8d167e
commit
9c13e29d4f
|
@ -24,13 +24,19 @@ sub calculate_backlinks () {
|
||||||
$backlinks_calculated=1;
|
$backlinks_calculated=1;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub backlinks ($) {
|
sub backlink_pages ($) {
|
||||||
my $page=shift;
|
my $page=shift;
|
||||||
|
|
||||||
calculate_backlinks();
|
calculate_backlinks();
|
||||||
|
|
||||||
|
return keys %{$backlinks{$page}};
|
||||||
|
}
|
||||||
|
|
||||||
|
sub backlinks ($) {
|
||||||
|
my $page=shift;
|
||||||
|
|
||||||
my @links;
|
my @links;
|
||||||
foreach my $p (keys %{$backlinks{$page}}) {
|
foreach my $p (backlink_pages($page)) {
|
||||||
my $href=urlto($p, $page);
|
my $href=urlto($p, $page);
|
||||||
|
|
||||||
# Trim common dir prefixes from both pages.
|
# Trim common dir prefixes from both pages.
|
||||||
|
|
Loading…
Reference in New Issue