fix Discussion links to not take the BestLink.

As a bonus we now have meta Disussion/Discussion pages available, etc. Oh
well.. :-)
master
joey 2006-03-14 06:04:44 +00:00
parent 2885278ebd
commit 7f8efe4524
4 changed files with 34 additions and 14 deletions

View File

@ -4,9 +4,6 @@
to point to it, but will forget to update the linkbacks in Foo/Baz. to point to it, but will forget to update the linkbacks in Foo/Baz.
And if Foo/Bar/Baz is then removed, it forgets to update Foo/Bar to link And if Foo/Bar/Baz is then removed, it forgets to update Foo/Bar to link
back to Foo/Baz. back to Foo/Baz.
Basically this makes creating new pages painful, top of TODO list..
* Foo/Bar/Baz shows up as Bar/Baz in the linkbacks on page Foo/Bar. Should * Foo/Bar/Baz shows up as Bar/Baz in the linkbacks on page Foo/Bar. Should
show as just Baz there. show as just Baz there.
* If I try to do a web commit, to a svn+ssh repo, it fails with * If I try to do a web commit, to a svn+ssh repo, it fails with
@ -20,3 +17,4 @@
replaced with a link to the [[CGI]]? replaced with a link to the [[CGI]]?
* [[ikiwiki]] should go to the same place as [[index]] (on this wiki). * [[ikiwiki]] should go to the same place as [[index]] (on this wiki).
* There's no way to escape a [[WikiLink]] when discussing one on a wiki. * There's no way to escape a [[WikiLink]] when discussing one on a wiki.
* Doesn't update pages that linked to a page when it is removed.

View File

@ -4,11 +4,21 @@ Currently implemented:
* [[Subversion]] * [[Subversion]]
Rather than implement its own system for storing page histories etc, ikiwiki simply uses subversion. (Supporting other revision control systems is also possible, ikiwiki only needs $FOO add, $FOO commit, and $FOO log). Rather than implement its own system for storing page histories etc,
ikiwiki simply uses subversion. (Supporting other revision control
systems is also possible, ikiwiki only needs $FOO add, $FOO commit, and
$FOO log).
Instead of editing pages in a stupid web form, you can use vim and commit changes via svn. Or work disconnected using svk and push your changes out when you come online. Deal with edit conflicts with others in a sane environment. Take advantage of subversion's smart merges. Instead of editing pages in a stupid web form, you can use vim and commit
changes via svn. Or work disconnected using svk and push your changes out
when you come online. Deal with edit conflicts with others in a sane
environment. Take advantage of subversion's smart merges.
ikiwiki can be run from a [[post-commit]] hook to update your wiki immediately whenever you commit. ikiwiki can be run from a [[post-commit]] hook to update your wiki
immediately whenever you commit.
Note that ikiwiki does not require subversion to function. If you want to
run a simple wiki without page history, it can do that too.
* [[MarkDown]] * [[MarkDown]]

View File

@ -86,4 +86,15 @@ allow for different types of setup files for more than just the one
hardcoded thing there is now, and would probably be good for upgrades, hardcoded thing there is now, and would probably be good for upgrades,
incompatible changes, etc, too. incompatible changes, etc, too.
## base wiki
Need a toned down version of this wiki with a basic frontpage, sandbox and
docs to use as a seed for new wikis.
## search
* full text (use third-party tools?)
* list of all missing pages
* list of all pages or some kind of page map
## [[Bugs]] ## [[Bugs]]

15
ikiwiki
View File

@ -210,9 +210,15 @@ sub htmllink { #{{{
my $page=shift; my $page=shift;
my $link=shift; my $link=shift;
my $noimageinline=shift; # don't turn links into inline html images my $noimageinline=shift; # don't turn links into inline html images
my $createsubpage=shift; # force creation of a subpage if page DNE my $forcesubpage=shift; # force a link to a subpage
my $bestlink=bestlink($page, $link); my $bestlink;
if (! $forcesubpage) {
$bestlink=bestlink($page, $link);
}
else {
$bestlink="$page/".lc($link);
}
return $link if length $bestlink && $page eq $bestlink; return $link if length $bestlink && $page eq $bestlink;
@ -224,13 +230,8 @@ sub htmllink { #{{{
$bestlink=htmlpage($bestlink); $bestlink=htmlpage($bestlink);
} }
if (! grep { $_ eq $bestlink } values %renderedfiles) { if (! grep { $_ eq $bestlink } values %renderedfiles) {
if (! $createsubpage) {
return "<a href=\"$config{cgiurl}?do=create&page=$link&from=$page\">?</a>$link" return "<a href=\"$config{cgiurl}?do=create&page=$link&from=$page\">?</a>$link"
} }
else {
return "<a href=\"$config{cgiurl}?do=create&page=$page/$link\">?</a>$link"
}
}
$bestlink=File::Spec->abs2rel($bestlink, dirname($page)); $bestlink=File::Spec->abs2rel($bestlink, dirname($page));