summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2010-11-16 15:00:04 -0400
committerJoey Hess <joey@kitenet.net>2010-11-16 15:00:04 -0400
commitec6c1269d251c78d2eef68cb789de6cfc6272464 (patch)
tree1579fecb0e077106b2dba5c8a8dd20597cf62bc2
parent021676e489f9b79a50338635ad654f31eb5575fe (diff)
more: Add pages parameter to limit where the more is displayed. (thanks, dark)
-rw-r--r--IkiWiki/Plugin/more.pm5
-rw-r--r--debian/changelog2
-rw-r--r--doc/ikiwiki/directive/more.mdwn5
-rw-r--r--doc/todo/selective_more_directive.mdwn2
4 files changed, 13 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/more.pm b/IkiWiki/Plugin/more.pm
index 80e339a1b..6880e366d 100644
--- a/IkiWiki/Plugin/more.pm
+++ b/IkiWiki/Plugin/more.pm
@@ -26,7 +26,10 @@ sub preprocess (@) {
$params{linktext} = $linktext unless defined $params{linktext};
- if ($params{page} ne $params{destpage}) {
+ if ($params{page} ne $params{destpage} &&
+ (! exists $params{pages} ||
+ pagespec_match($params{destpage}, $params{pages},
+ location => $params{page}))) {
return "\n".
htmllink($params{page}, $params{destpage}, $params{page},
linktext => $params{linktext},
diff --git a/debian/changelog b/debian/changelog
index 91ff0964b..faabf1993 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,8 @@
ikiwiki (3.20101113) UNRELEASED; urgency=low
* websetup: Fix encoding problem when restoring old setup file.
+ * more: Add pages parameter to limit where the more is displayed.
+ (thanks, dark)
-- Joey Hess <joeyh@debian.org> Tue, 16 Nov 2010 14:23:47 -0400
diff --git a/doc/ikiwiki/directive/more.mdwn b/doc/ikiwiki/directive/more.mdwn
index 506551910..bda1427f3 100644
--- a/doc/ikiwiki/directive/more.mdwn
+++ b/doc/ikiwiki/directive/more.mdwn
@@ -11,6 +11,11 @@ leads to the full version of the page. Use it like this:
If the `linktext` parameter is omitted it defaults to just "more".
+An optional `pages` parameter can be used to specify a
+[[ikiwiki/PageSpec]], and then the "more" link will only be displayed
+when the page is inlined into a page matching that PageSpec, and otherwise
+the full content shown.
+
Note that you can accomplish something similar using a [[toggle]] instead.
[[!meta robots="noindex, follow"]]
diff --git a/doc/todo/selective_more_directive.mdwn b/doc/todo/selective_more_directive.mdwn
index 24e6ab568..2a9998205 100644
--- a/doc/todo/selective_more_directive.mdwn
+++ b/doc/todo/selective_more_directive.mdwn
@@ -24,3 +24,5 @@ I can now call it as
I'm not entirely happy with the design, since I would rather put this information in the inline directive instead of in every story post. Unfortunately I found no way to pass parameters from the inline directive to the inlined page.
-- [[dark]]
+
+> Me neither, but nor do I see a better way, so [[applied|done]]. --[[Joey]]