Merge branch 'master' into comments

master
Joey Hess 2008-12-12 14:21:08 -05:00
commit 41efa5ac92
8 changed files with 43 additions and 23 deletions

View File

@ -312,8 +312,7 @@ sub preprocess_inline (@) { #{{{
# emptyfeeds cannot be hidden. # emptyfeeds cannot be hidden.
$emptyfeeds=1; $emptyfeeds=1;
} }
elsif ($feeds && !$params{preview} && elsif ($feeds && !$params{preview} && ($emptyfeeds || @feedlist)) {
! (! $emptyfeeds && ! @feedlist)) {
# Add feed buttons. # Add feed buttons.
my $linktemplate=template("feedlink.tmpl", blind_cache => 1); my $linktemplate=template("feedlink.tmpl", blind_cache => 1);
$linktemplate->param(rssurl => $rssurl) if $rss; $linktemplate->param(rssurl => $rssurl) if $rss;
@ -390,7 +389,7 @@ sub preprocess_inline (@) { #{{{
} }
} }
if ($feeds && ! (! $emptyfeeds && ! @feedlist)) { if ($feeds && ($emptyfeeds || @feedlist)) {
if ($rss) { if ($rss) {
my $rssp=$feedbase."rss".$feednum; my $rssp=$feedbase."rss".$feednum;
will_render($params{destpage}, $rssp); will_render($params{destpage}, $rssp);

View File

@ -38,9 +38,10 @@ sub needsbuild (@) { #{{{
} }
} }
sub scrub ($) { #{{{ sub scrub ($$) { #{{{
if (IkiWiki::Plugin::htmlscrubber->can("sanitize")) { if (IkiWiki::Plugin::htmlscrubber->can("sanitize")) {
return IkiWiki::Plugin::htmlscrubber::sanitize(content => shift); return IkiWiki::Plugin::htmlscrubber::sanitize(
content => shift, destpage => shift);
} }
else { else {
return shift; return shift;
@ -137,7 +138,7 @@ sub preprocess (@) { #{{{
elsif ($key eq 'permalink') { elsif ($key eq 'permalink') {
if (safeurl($value)) { if (safeurl($value)) {
$pagestate{$page}{meta}{permalink}=$value; $pagestate{$page}{meta}{permalink}=$value;
push @{$metaheaders{$page}}, scrub('<link rel="bookmark" href="'.encode_entities($value).'" />'); push @{$metaheaders{$page}}, scrub('<link rel="bookmark" href="'.encode_entities($value).'" />', $destpage);
} }
} }
elsif ($key eq 'stylesheet') { elsif ($key eq 'stylesheet') {
@ -206,7 +207,7 @@ sub preprocess (@) { #{{{
my $delay=int(exists $params{delay} ? $params{delay} : 0); my $delay=int(exists $params{delay} ? $params{delay} : 0);
my $redir="<meta http-equiv=\"refresh\" content=\"$delay; URL=$value\" />"; my $redir="<meta http-equiv=\"refresh\" content=\"$delay; URL=$value\" />";
if (! $safe) { if (! $safe) {
$redir=scrub($redir); $redir=scrub($redir, $destpage);
} }
push @{$metaheaders{$page}}, $redir; push @{$metaheaders{$page}}, $redir;
} }
@ -216,7 +217,7 @@ sub preprocess (@) { #{{{
join(" ", map { join(" ", map {
encode_entities($_)."=\"".encode_entities(decode_entities($params{$_}))."\"" encode_entities($_)."=\"".encode_entities(decode_entities($params{$_}))."\""
} keys %params). } keys %params).
" />\n"); " />\n", $destpage);
} }
} }
elsif ($key eq 'robots') { elsif ($key eq 'robots') {
@ -225,7 +226,7 @@ sub preprocess (@) { #{{{
} }
else { else {
push @{$metaheaders{$page}}, scrub('<meta name="'.encode_entities($key). push @{$metaheaders{$page}}, scrub('<meta name="'.encode_entities($key).
'" content="'.encode_entities($value).'" />'); '" content="'.encode_entities($value).'" />', $destpage);
} }
return ""; return "";

1
debian/changelog vendored
View File

@ -13,6 +13,7 @@ ikiwiki (2.71) UNRELEASED; urgency=low
* inline: Support emptyfeeds=no option to skip generating empty feeds. * inline: Support emptyfeeds=no option to skip generating empty feeds.
* inline: Support feedfile option to change the filename of the feed * inline: Support feedfile option to change the filename of the feed
generated. generated.
* meta: Pass info to htmlscrubber so htmlscrubber_skip can take effect.
-- Joey Hess <joeyh@debian.org> Mon, 17 Nov 2008 14:02:10 -0500 -- Joey Hess <joeyh@debian.org> Mon, 17 Nov 2008 14:02:10 -0500

View File

@ -0,0 +1,5 @@
In IkiWiki/Wrapper.pm, the gen_wrapper function finds out what srcdir and destdir are set to in the config, but does not use them.
Later in the sub, when a new wiki.cgi wrapper is being created when calling ikiwiki --setup /path/to/setup, it will only work if cgi\_wrapper in the config file is set to the full path. Otherwise, it creates wiki.cgi in the current working directory. It works with the other wrapper it sets up in my config - post\_update (using git), as that shows in the config with a full path.
One workaround would be to mention in the setup file that cgi_wrapper has to be the full path, not just the file name, but that seems silly when destdir is also specified in that file and that's where it should go, and $config{destdir} is a known value in the Wrapper.pm file.

View File

@ -0,0 +1,11 @@
I have been trying to include some meta info using the link setting something like the below
meta link="http://www.example.com/" rel="command" name="Example"
This gets removed by the htmlscrubber as you would expect.
Setting htmlscrubber_skip to the pagespec should stop this getting scrubbed but it does not.
Below is a patch to fix that. It seams to work but I am not sure of it is the correct thing to do.
> [[done]], thanks for the patch --[[Joey]]

View File

@ -17,11 +17,11 @@ follow the paste directive that uses its text. In fact, this is quite useful
to postpone big blocks of text like long annotations and have a more natural to postpone big blocks of text like long annotations and have a more natural
flow. For example: flow. For example:
\[[!toggleable id="cut" text="\[[!paste id=cutlongdesc]]"]] \[[!toggleable id="cut" text="[[!paste id=cutlongdesc]]"]]
\[[!toggleable id="copy" text="\[[!paste id=copylongdesc]]"]] \[[!toggleable id="copy" text="[[!paste id=copylongdesc]]"]]
\[[!toggleable id="paste" text="\[[!paste id=pastelongdesc]]"]] \[[!toggleable id="paste" text="[[!paste id=pastelongdesc]]"]]
\[...some time later...] [...some time later...]
\[[!cut id=cutlongdesc text=""" \[[!cut id=cutlongdesc text="""
blah blah blah blah blah blah
@ -40,7 +40,7 @@ Since you can paste without using double quotes, copy and paste can be used to
nest directives that require multiline parameters inside each other: nest directives that require multiline parameters inside each other:
\[[!toggleable id=foo text=""" \[[!toggleable id=foo text="""
\[[!toggleable id=bar text="\[[!paste id=baz]]"]] [[!toggleable id=bar text="[[!paste id=baz]]"]]
"""]] """]]
\[[!cut id=baz text=""" \[[!cut id=baz text="""

View File

@ -50,12 +50,12 @@ can use the following additional `<TMPL_VAR>`s:
* `COMMENTAUTHORURL`: if the user was signed in with an OpenID, that URL; if the user was signed * `COMMENTAUTHORURL`: if the user was signed in with an OpenID, that URL; if the user was signed
in with some other username, a CGI URL that redirects to their user page (if any) in with some other username, a CGI URL that redirects to their user page (if any)
This plugin also adds a `\[[!comment]]` directive which is used when storing comments. This This plugin also adds a `\[[!_comment]]` directive which is used when storing comments. This
directive shouldn't be used on pages that are edited in the usual way. directive is for internal use only and shouldn't be used on pages that are edited in the usual way.
This plugin aims to close the [[todo]] item "[[todo/supporting_comments_via_disussion_pages]]", This plugin aims to close the [[todo]] item "[[todo/supporting_comments_via_disussion_pages]]",
and is currently available from [[smcv]]'s git repository on git.pseudorandom.co.uk (it's the and is currently available from [[smcv]]'s git repository on git.pseudorandom.co.uk (it's the
`comments-rebase1` branch). A demo wiki with the plugin enabled is running at `comments-rebase2` branch). A demo wiki with the plugin enabled is running at
<http://www.pseudorandom.co.uk/2008/ikiwiki/demo/>; the <http://www.pseudorandom.co.uk/2008/ikiwiki/demo/>; the
[sandbox page](http://www.pseudorandom.co.uk/2008/ikiwiki/demo/sandbox/#comments) has some [sandbox page](http://www.pseudorandom.co.uk/2008/ikiwiki/demo/sandbox/#comments) has some
examples of comments. examples of comments.
@ -67,11 +67,10 @@ Known issues:
* There is some common code cargo-culted from other plugins (notably inline and editpage) which * There is some common code cargo-culted from other plugins (notably inline and editpage) which
should probably be shared should probably be shared
* Joey doesn't think it should necessarily use internal pages (see [[discussion]]) * Joey doesn't think it should necessarily use internal pages (see [[discussion]])
* `\[[!comment]]` should perhaps be `\[[!_comment]]`, or a special filter/htmlize hook rather
than being a directive at all
* Previews always say "unknown IP address" * Previews always say "unknown IP address"
* [[todo/inline_plugin:_ability_to_override_the_feed_name]] * Add `COMMENTOPENID`: the authenticated/verified user name, if and only if it was an OpenID
* [[todo/inline_plugin:_hide_feed_buttons_if_empty]] * The default template should have a (?) icon next to unauthenticated users (with the IP address
as title) and an OpenID icon next to OpenIDs
> I haven't done a detailed code review, but I will say I'm pleased you > I haven't done a detailed code review, but I will say I'm pleased you
> avoided re-implementing inline! --[[Joey]] > avoided re-implementing inline! --[[Joey]]
@ -84,5 +83,9 @@ Fixed issues:
* tbm wanted anonymous people to be able to enter their name and possibly email * tbm wanted anonymous people to be able to enter their name and possibly email
address; a name and website can now be supplied address; a name and website can now be supplied
* There is now an indication of who you're signed in as * There is now an indication of who you're signed in as
* Each comment is now one big \[[!comment]] directive invocation, avoiding previous * Each comment is now one big \[[!_comment]] directive invocation, avoiding previous
issues with unambiguous and un-spoofable metadata issues with unambiguous and un-spoofable metadata
* `\[[!comment]]` should be `\[[!_comment]]`, or a special filter/htmlize hook rather
than being a directive at all
* [[todo/inline_plugin:_ability_to_override_the_feed_name]]
* [[todo/inline_plugin:_hide_feed_buttons_if_empty]]

View File

@ -1,4 +1,4 @@
[[!template id=plugin name=toggle author="[[Enrico]]"]] [[!template id=plugin name=cutpaste author="[[Enrico]]"]]
[[!tag type/chrome]] [[!tag type/chrome]]
This plugin provides the [[ikiwiki/directive/cut]], This plugin provides the [[ikiwiki/directive/cut]],