po: make the "backlinks involve dependencies" feature optional

It can now be configured with the po_strictly_refresh_backlinks setting.

Signed-off-by: intrigeri <intrigeri@boum.org>
master
intrigeri 2009-01-27 00:19:41 +01:00
parent 03ab262319
commit ca9e45c3ba
2 changed files with 29 additions and 4 deletions

View File

@ -126,6 +126,13 @@ sub getsetup () {
safe => 1, safe => 1,
rebuild => 1, rebuild => 1,
}, },
po_strictly_refresh_backlinks => {
type => "boolean",
example => 1,
description => "refresh a page when a backlinked page is changed (can hit performance)",
safe => 1,
rebuild => 1,
},
} }
sub checkconfig () { sub checkconfig () {
@ -166,6 +173,10 @@ sub checkconfig () {
! defined $config{po_translation_status_in_links}) { ! defined $config{po_translation_status_in_links}) {
$config{po_translation_status_in_links}=1; $config{po_translation_status_in_links}=1;
} }
if (! exists $config{po_strictly_refresh_backlinks} ||
! defined $config{po_strictly_refresh_backlinks}) {
$config{po_strictly_refresh_backlinks}=1;
}
push @{$config{wiki_file_prune_regexps}}, qr/\.pot$/; push @{$config{wiki_file_prune_regexps}}, qr/\.pot$/;
} }
@ -307,8 +318,10 @@ sub pagetemplate (@) {
sub postscan (@) { sub postscan (@) {
my %params = @_; my %params = @_;
my $page = $params{page};
return unless $config{po_strictly_refresh_backlinks};
my $page = $params{page};
# backlinks involve back-dependencies, so that nicepagetitle effects, # backlinks involve back-dependencies, so that nicepagetitle effects,
# such as translation status displayed in links, are updated # such as translation status displayed in links, are updated
use IkiWiki::Render; use IkiWiki::Render;

View File

@ -72,17 +72,19 @@ worry about excluding them explicitly from this [[ikiwiki/PageSpec]].
Internal links Internal links
-------------- --------------
### Links targets
The `po_link_to` option in `ikiwiki.setup` is used to decide how The `po_link_to` option in `ikiwiki.setup` is used to decide how
internal links should be generated, depending on web server features internal links should be generated, depending on web server features
and site-specific preferences. and site-specific preferences.
### Default linking behavior #### Default linking behavior
If `po_link_to` is unset, or set to `default`, ikiwiki's default If `po_link_to` is unset, or set to `default`, ikiwiki's default
linking behavior is preserved: `\[[destpage]]` links to the master linking behavior is preserved: `\[[destpage]]` links to the master
language's page. language's page.
### Link to current language #### Link to current language
If `po_link_to` is set to `current`, `\[[destpage]]` links to the If `po_link_to` is set to `current`, `\[[destpage]]` links to the
`destpage`'s version written in the current page's language, if `destpage`'s version written in the current page's language, if
@ -91,7 +93,7 @@ available, *i.e.*:
* `foo/destpage/index.LL.html` if `usedirs` is enabled * `foo/destpage/index.LL.html` if `usedirs` is enabled
* `foo/destpage.LL.html` if `usedirs` is disabled * `foo/destpage.LL.html` if `usedirs` is disabled
### Link to negotiated language #### Link to negotiated language
If `po_link_to` is set to `negotiated`, `\[[page]]` links to the If `po_link_to` is set to `negotiated`, `\[[page]]` links to the
negotiated preferred language, *i.e.* `foo/page/`. negotiated preferred language, *i.e.* `foo/page/`.
@ -104,6 +106,16 @@ negotiated preferred language, *i.e.* `foo/page/`.
* if the web server does not support Content Negotiation, setting * if the web server does not support Content Negotiation, setting
`po_link_to` to `negotiated` will produce a unusable website. `po_link_to` to `negotiated` will produce a unusable website.
### Links appearance
When `po_translation_status_in_links` is enabled, the text of a link
to a slave pages displays this page's translation status.
When the `po_strictly_refresh_backlinks` setting is enabled, a page is
refreshed every time a backlinked page is changed. This updates the
translation status in links, and helps having a consistent translated
wiki. Beware, this make every page depend on every page that links to
it, which can slow everything down and bloat the dependency pagespecs.
Server support Server support
============== ==============