From f62d23f008367d403f6f75a1673c673b2137f49b Mon Sep 17 00:00:00 2001 From: joey Date: Fri, 29 Dec 2006 05:33:20 +0000 Subject: * If a userdir is configured, links to pages in it can be made without specifying the path. This allows for easy signing of comments by linking to your page in the userdir. --- IkiWiki.pm | 4 ++++ IkiWiki/CGI.pm | 2 ++ basewiki/subpage/linkingrules.mdwn | 5 +++++ debian/changelog | 5 ++++- doc/index/chris.mdwn | 5 ----- doc/jeremyreed.mdwn | 1 - doc/joey.mdwn | 6 ------ doc/jonassmedegaard.mdwn | 3 --- doc/todo/userdir_links.mdwn | 2 ++ doc/users.mdwn | 5 +++++ doc/users/chris.mdwn | 5 +++++ doc/users/jeremyreed.mdwn | 1 + doc/users/joey.mdwn | 6 ++++++ doc/users/jonassmedegaard.mdwn | 3 +++ 14 files changed, 37 insertions(+), 16 deletions(-) delete mode 100644 doc/index/chris.mdwn delete mode 100644 doc/jeremyreed.mdwn delete mode 100644 doc/joey.mdwn delete mode 100644 doc/jonassmedegaard.mdwn create mode 100644 doc/users.mdwn create mode 100644 doc/users/chris.mdwn create mode 100644 doc/users/jeremyreed.mdwn create mode 100644 doc/users/joey.mdwn create mode 100644 doc/users/jonassmedegaard.mdwn diff --git a/IkiWiki.pm b/IkiWiki.pm index 2ee27ac3e..960d4da99 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -319,6 +319,10 @@ sub bestlink ($$) { #{{{ } } while $cwd=~s!/?[^/]+$!!; + if (length $config{userdir} && exists $links{"$config{userdir}/".lc($link)}) { + return $links{"$config{userdir}/".lc($link)}; + } + #print STDERR "warning: page $page, broken link: $link\n"; return ""; } #}}} diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index 511358ff5..7f84f345a 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -419,6 +419,8 @@ sub cgi_editpage ($$) { #{{{ push @page_locs, $dir.$page; } } + push @page_locs, "$config{userdir}/$page" + if length $config{userdir}; @page_locs = grep { ! exists $pagecase{lc $_} && diff --git a/basewiki/subpage/linkingrules.mdwn b/basewiki/subpage/linkingrules.mdwn index c07a81387..c1062304a 100644 --- a/basewiki/subpage/linkingrules.mdwn +++ b/basewiki/subpage/linkingrules.mdwn @@ -25,3 +25,8 @@ to link to, when there are multiple pages with similar names and the link goes to the wrong page by default. For example, linking from "FooBar/SubPage" to "/OtherPage" will link to the "OtherPage" in the root of the wiki, even if there is a "FooBar/OtherPage". + +Also, if the wiki is configured with a userdir, you can link to pages +within the userdir without specifying a path to them. This is to allow for +easy linking to a user's page in the userdir, to sign a comment. These +links are checked for last of all. diff --git a/debian/changelog b/debian/changelog index 9d6b7a42a..0735c2db7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -20,8 +20,11 @@ ikiwiki (1.37) UNRELEASED; urgency=low * Don't put discussion links on discussion pages. * Allow disabling of plugins included in goodstuff. * Add a textile format plugin contributed by mazirian. + * If a userdir is configured, links to pages in it can be made without + specifying the path. This allows for easy signing of comments by linking + to your page in the userdir. - -- Joey Hess Fri, 29 Dec 2006 00:17:58 -0500 + -- Joey Hess Fri, 29 Dec 2006 00:26:47 -0500 ikiwiki (1.36) unstable; urgency=low diff --git a/doc/index/chris.mdwn b/doc/index/chris.mdwn deleted file mode 100644 index ed9f0e619..000000000 --- a/doc/index/chris.mdwn +++ /dev/null @@ -1,5 +0,0 @@ -Chris is Chris Green, an ancient C/C++/Java programmer, I started around 1982 or 1983. - -I was programming even before that in assembler and things like that, I was first programming for a living in about 1970. - -I'm considering using ikiwiki for keeping notes and maybe a ToDo list etc. \ No newline at end of file diff --git a/doc/jeremyreed.mdwn b/doc/jeremyreed.mdwn deleted file mode 100644 index 3ae8e0d4b..000000000 --- a/doc/jeremyreed.mdwn +++ /dev/null @@ -1 +0,0 @@ -I am testing ikiwiki. I made a RCS plugin. \ No newline at end of file diff --git a/doc/joey.mdwn b/doc/joey.mdwn deleted file mode 100644 index c60c76fe8..000000000 --- a/doc/joey.mdwn +++ /dev/null @@ -1,6 +0,0 @@ -Joey Hess is joey@kitenet.net. -His web page is [here](http://kitenet.net/~joey/). - -Joey hates programming web crap, and hates being locked into a web browser -to do something, and this probably shows in the design choices made in -ikiwiki. diff --git a/doc/jonassmedegaard.mdwn b/doc/jonassmedegaard.mdwn deleted file mode 100644 index 653883979..000000000 --- a/doc/jonassmedegaard.mdwn +++ /dev/null @@ -1,3 +0,0 @@ -Jonas Smedegaard is a Debian developer, like joey. A big fan of this novel approach to wiki: serving as pages static! - -JonasSmedegaard maintains the packaging of another wiki - MoinMoin - for Debian, but is personally tired of the heavy burden of Python on his web servers. diff --git a/doc/todo/userdir_links.mdwn b/doc/todo/userdir_links.mdwn index 02ebea6d6..02dbdaa65 100644 --- a/doc/todo/userdir_links.mdwn +++ b/doc/todo/userdir_links.mdwn @@ -1,3 +1,5 @@ The userdir should be searched at the end of the search "path" for links, so that users can put their pages in the userdir, and still link to them easily when signing things, without giving a path. + +[[todo/done]] diff --git a/doc/users.mdwn b/doc/users.mdwn new file mode 100644 index 000000000..3b8434a4c --- /dev/null +++ b/doc/users.mdwn @@ -0,0 +1,5 @@ +See [[IkiwikiUsers]] for the list of sites using ikiwiki. + +Users of this wiki, feel free to create a subpage of this one and talk +about yourself on it, within reason. You can link to it to sign your +comments. diff --git a/doc/users/chris.mdwn b/doc/users/chris.mdwn new file mode 100644 index 000000000..ed9f0e619 --- /dev/null +++ b/doc/users/chris.mdwn @@ -0,0 +1,5 @@ +Chris is Chris Green, an ancient C/C++/Java programmer, I started around 1982 or 1983. + +I was programming even before that in assembler and things like that, I was first programming for a living in about 1970. + +I'm considering using ikiwiki for keeping notes and maybe a ToDo list etc. \ No newline at end of file diff --git a/doc/users/jeremyreed.mdwn b/doc/users/jeremyreed.mdwn new file mode 100644 index 000000000..3ae8e0d4b --- /dev/null +++ b/doc/users/jeremyreed.mdwn @@ -0,0 +1 @@ +I am testing ikiwiki. I made a RCS plugin. \ No newline at end of file diff --git a/doc/users/joey.mdwn b/doc/users/joey.mdwn new file mode 100644 index 000000000..c60c76fe8 --- /dev/null +++ b/doc/users/joey.mdwn @@ -0,0 +1,6 @@ +Joey Hess is joey@kitenet.net. +His web page is [here](http://kitenet.net/~joey/). + +Joey hates programming web crap, and hates being locked into a web browser +to do something, and this probably shows in the design choices made in +ikiwiki. diff --git a/doc/users/jonassmedegaard.mdwn b/doc/users/jonassmedegaard.mdwn new file mode 100644 index 000000000..653883979 --- /dev/null +++ b/doc/users/jonassmedegaard.mdwn @@ -0,0 +1,3 @@ +Jonas Smedegaard is a Debian developer, like joey. A big fan of this novel approach to wiki: serving as pages static! + +JonasSmedegaard maintains the packaging of another wiki - MoinMoin - for Debian, but is personally tired of the heavy burden of Python on his web servers. -- cgit v1.2.3