Merge branch 'master' of ssh://git.ikiwiki.info/srv/git/ikiwiki.info

master
Joey Hess 2009-11-22 15:08:29 -05:00
commit aeaaeecd51
5 changed files with 71 additions and 62 deletions

View File

@ -7,3 +7,54 @@ If sandbox/page.mdwn has been generated and sandbox/sidebar.mdwn is created, the
# currently requires a wiki rebuild.
add_depends($page, $sidebar_page);
----
Below is a patch for the bug. It's inspired by trying to solve [[todo/Post-compilation inclusion of the sidebar]].
What do you think about it? I have a concern though. If a sidebar is removed, it takes two refreshes to update
the affected pages. Is this a feature or a bug? --[[harishcm]]
--- sidebar.pm.orig 2009-11-21 17:40:02.000000000 +0800
+++ sidebar_bugfix.pm 2009-11-21 18:16:11.000000000 +0800
@@ -10,6 +10,7 @@
sub import {
hook(type => "getsetup", id => "sidebar", call => \&getsetup);
+ hook(type => "needsbuild", id => "sidebar", call => \&needsbuild);
hook(type => "pagetemplate", id => "sidebar", call => \&pagetemplate);
}
@@ -21,6 +22,22 @@
},
}
+sub needsbuild (@) {
+ my $needsbuild=shift;
+
+ # Determine every pages' sidebar page
+ foreach my $page (keys %pagesources) {
+ my $sidebar_page='';
+ $sidebar_page=bestlink($page, "sidebar");
+
+ # If a page's sidebar has changed, force rebuild
+ if (!exists $pagestate{$page}{sidebar}{sidebar_page} || $pagestate{$page}{sidebar}{sidebar_page} ne $sidebar_page) {
+ $pagestate{$page}{sidebar}{sidebar_page} = $sidebar_page;
+ push @$needsbuild, $pagesources{$page};
+ }
+ }
+}
+
sub sidebar_content ($) {
my $page=shift;
@@ -29,9 +46,9 @@
my $sidebar_type=pagetype($sidebar_file);
if (defined $sidebar_type) {
- # FIXME: This isn't quite right; it won't take into account
- # adding a new sidebar page. So adding such a page
- # currently requires a wiki rebuild.
+ # Record current sidebar page for rechecking bestlink
+ # during wiki refresh. Also add depends on the sidebar page.
+ $pagestate{$page}{sidebar}{sidebar_page}=$sidebar_page;
add_depends($page, $sidebar_page);
my $content=readfile(srcfile($sidebar_file));

View File

@ -1,61 +1 @@
This is the [[SandBox]], a page anyone can edit to try out ikiwiki (version [[!version ]]).
# Header
## Subheader
> This is a blockquote.
>
> This is the first level of quoting.
>
> > This is nested blockquote.
>
>> Without a space works too.
>>> to three levels
>
> Back to the first level.
Numbered list
1. First item.
1. Sub item.
1. Another.
1. And another..
1. foo
2. bar
Bulleted list
* item
* *item*
* item
* one
* two
----
[[!template id=note text="this is generated by the [[plugins/haiku]] plugin"]]
[[!haiku hint="sandbox play"]]
----
## Different sorts of links:
* [[Features]]
* <http://ikiwiki.info/ikiwiki/formatting/>
* [[different_name_for_a_WikiLink|ikiwiki/WikiLink]]
* <http://www.gnu.org/>
* [GNU](http://www.gnu.org/)
-----
[[!progress percent=27]]
[[!progress percent=78]]
-----
This **SandBox** is also a [[blog]]!
[[!inline pages="sandbox/* and !*/Discussion" rootpage="sandbox" show="4" archive="yes"]]
TEST

View File

@ -18,3 +18,19 @@ Does this sound okay?
> todo/bugs/forum feeds, or to some other feed they create on their user page.
> And there's work on making the discussion pages more structured, on
> accepting comments sent via mail, etc. --[[Joey]]
>>I was going to make the very same request, so I'm glad to know I'm not the only one who felt the need for it.
>>I can see your reasoning, though I don't think ikiwiki has reached the level (yet) of facilitating discussion as well as a mailing list does.
>>You've already pointed out the need for (a) more structured discussion pages, (b) comments sent via mail, but I'm not sure whether that will be enough. This is because the nature of a wiki means that discussions are scattered all over the site, as people discuss in discussion pages about the given topic - and so they should. The consequence of this, however, is that one has a choice (in regard to RSS feeds) of having too much or too little. Too little, if one only feeds on news/todo/bugs/forum, since one misses out on discussions elsewhere. Too much, because the only other option appears to be subscribing to recentchanges, which will give one *everything*, whether it is relevant or not.
>>Unfortunately, I'm not really sure what the best solution is for this problem.
>> For those who might be interested, I've added the following RSS feeds to <http://www.dreamwidth.org>:
*ikiwiki_bugs_feed,
ikiwiki_forum_feed,
ikiwiki_news_feed,
ikiwiki_recent_feed,
ikiwiki_todo_feed,
ikiwiki_wishlist_feed*
>>--[[KathrynAndersen]]

View File

@ -0,0 +1,2 @@
* Currently an active [PmWiki](http://www.pmwiki.org) user, but investigating changing over to ikiwiki (if I can write the plugins I need).
* <http://kerravonsen.dreamwidth.org>

View File

@ -1 +1 @@
Using ikiwiki for my yet to be publish personal website :)
Using ikiwiki for my yet to be published personal website :)