summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--IkiWiki.pm10
-rw-r--r--IkiWiki/Plugin/inline.pm5
-rw-r--r--IkiWiki/Plugin/poll.pm11
-rw-r--r--debian/changelog1
-rw-r--r--doc/bugs/title__40____41___in_a_PageSpec__44___with_meta_enabled__44___causes_a_crash.mdwn25
-rw-r--r--doc/todo/aggregate_to_internal_pages.mdwn28
6 files changed, 65 insertions, 15 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm
index c1d9119e8..f1a5f8058 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -337,7 +337,7 @@ sub readfile ($;$$) { #{{{
return $ret;
} #}}}
-sub prep_writefile ($$) {
+sub prep_writefile ($$) { #{{{
my $file=shift;
my $destdir=shift;
@@ -361,7 +361,7 @@ sub prep_writefile ($$) {
}
return 1;
-}
+} #}}}
sub writefile ($$$;$$) { #{{{
my $file=shift; # can include subdirs
@@ -1202,6 +1202,12 @@ sub gettext { #{{{
}
} #}}}
+sub yesno ($) { #{{{
+ my $val=shift;
+
+ return (defined $val && lc($val) eq gettext("yes"));
+} #}}}
+
sub pagespec_merge ($$) { #{{{
my $a=shift;
my $b=shift;
diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm
index 2dcd1a90a..02c04cc00 100644
--- a/IkiWiki/Plugin/inline.pm
+++ b/IkiWiki/Plugin/inline.pm
@@ -94,11 +94,6 @@ package IkiWiki;
my %toping;
my %feedlinks;
-sub yesno ($) { #{{{
- my $val=shift;
- return (defined $val && lc($val) eq "yes");
-} #}}}
-
sub preprocess_inline (@) { #{{{
my %params=@_;
diff --git a/IkiWiki/Plugin/poll.pm b/IkiWiki/Plugin/poll.pm
index 6edf233b4..32cb5c48f 100644
--- a/IkiWiki/Plugin/poll.pm
+++ b/IkiWiki/Plugin/poll.pm
@@ -11,18 +11,13 @@ sub import { #{{{
hook(type => "sessioncgi", id => "poll", call => \&sessioncgi);
} # }}}
-sub yesno ($) { #{{{
- my $val=shift;
- return (defined $val && lc($val) eq "yes");
-} #}}}
-
my %pagenum;
sub preprocess (@) { #{{{
my %params=(open => "yes", total => "yes", percent => "yes", @_);
- my $open=yesno($params{open});
- my $showtotal=yesno($params{total});
- my $showpercent=yesno($params{percent});
+ my $open=IkiWIki::yesno($params{open});
+ my $showtotal=IkiWiki::yesno($params{total});
+ my $showpercent=IkiWiki::yesno($params{percent});
$pagenum{$params{page}}++;
my %choices;
diff --git a/debian/changelog b/debian/changelog
index ea3ba077b..0694b8190 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -17,6 +17,7 @@ ikiwiki (2.54) UNRELEASED; urgency=low
numerous bugs.
* meta: Support a guid option, to allow forcing a particular url or
uuid in feeds. (smcv)
+ * Move yesno function out of inline and into IkiWiki core, not exported.
-- Josh Triplett <josh@freedesktop.org> Wed, 09 Jul 2008 21:30:33 -0700
diff --git a/doc/bugs/title__40____41___in_a_PageSpec__44___with_meta_enabled__44___causes_a_crash.mdwn b/doc/bugs/title__40____41___in_a_PageSpec__44___with_meta_enabled__44___causes_a_crash.mdwn
new file mode 100644
index 000000000..2f9c10611
--- /dev/null
+++ b/doc/bugs/title__40____41___in_a_PageSpec__44___with_meta_enabled__44___causes_a_crash.mdwn
@@ -0,0 +1,25 @@
+When the meta plugin is enabled, use of the title() predicate in a [[PageSpec]] fails with "Undefined subroutine &IkiWiki::Plugin::meta::pagetitle called". The [[patch]] is to replace "pagetitle" with "IkiWiki::pagetitle" in the meta plugin, as in [this git commit](http://git.debian.org/?p=users/smcv/ikiwiki.git;a=commit;h=1f26a1bf1655b1d0223b24ba1db70579a3774eb1) (git://git.debian.org/git/users/smcv/ikiwiki.git, branch=master, commit=1f26a).
+
+Applying the changes shown here to ikiwiki's docwiki, and rebuilding its docwiki, is sufficient to reproduce this bug.
+
+ diff --git a/doc/sandbox.mdwn b/doc/sandbox.mdwn
+ index 5c7368f..8aaa032 100644
+ --- a/doc/sandbox.mdwn
+ +++ b/doc/sandbox.mdwn
+ @@ -78,4 +78,4 @@ The haiku will change after every save, mind you.
+
+ This sandbox is also a [[ikiwiki/blog]]!
+
+ -[[inline pages="sandbox/* and !*/Discussion" rootpage="sandbox" show="4" archive="yes"]]
+ +[[inline pages="sandbox/* and !title(*s3kr1t*) and !*/Discussion" rootpage="sandbox" show="4" archive="yes"]]
+ diff --git a/docwiki.setup b/docwiki.setup
+ index 0a6a866..65590f0 100644
+ --- a/docwiki.setup
+ +++ b/docwiki.setup
+ @@ -15,5 +15,5 @@ use IkiWiki::Setup::Standard {
+ syslog => 0,
+ userdir => "users",
+ usedirs => 0,
+ - add_plugins => [qw{goodstuff version haiku polygen fortune}],
+ + add_plugins => [qw{goodstuff version haiku polygen fortune meta inline}],
+ }
diff --git a/doc/todo/aggregate_to_internal_pages.mdwn b/doc/todo/aggregate_to_internal_pages.mdwn
index b7b77fc03..614407c9d 100644
--- a/doc/todo/aggregate_to_internal_pages.mdwn
+++ b/doc/todo/aggregate_to_internal_pages.mdwn
@@ -5,3 +5,31 @@ How to transition to it though? inlines of aggregated content would need to
change their pagespecs to use `internal()`.
> [[patch]] in git://git.debian.org/git/users/smcv/ikiwiki.git, branch "aggregate"; [see also gitweb](http://git.debian.org/?p=users/smcv/ikiwiki.git;a=commit;h=01d7ae803710bb0d84fc8d172fd98fd57fb77e9d). --smcv.pseudorandom.co.uk
+> Migration is a two-step process: first change all your pagespecs to use `internal()`, then add `internalize="yes"` to all your aggregate invocations. --smcv.pseudorandom.co.uk
+
+> Thanks for working on this.
+>
+> I see one problem, if internalize is flipped on and there are existing
+> aggregated pages, htmlfn will not return the right filename for those
+> pages when expiring them. Seems that `$was_internal` (or just the full
+> source filename) should be recorded on a per-guid basis. Could you do
+> that?
+>
+> I'm weighing the added complexity of having an internalize option
+> (which people would have to add, and would probably forget), with just
+> making aggregate create all new pages as internal, and having a flag day
+> where all inlines and other uses of aggregated pages have to change
+> pagespecs to use `isinternal()`.
+>
+> There are real bugs that are fixed by making
+> aggregated plugins internal, including:
+> - Avoids web edits to aggregated pages. (Arguably a security hole;
+> though they can be locked..)
+> - Significant speed improvements.
+> - Less disk use.
+>
+> If internal has to be manually enabled, people will forget to. I'd rather
+> not have to worry about these bugs in the future. So, I'm thinking flag
+> day. --[[Joey]]
+
+[[patch]]