aboutsummaryrefslogtreecommitdiff
path: root/doc/todo/selective_more_directive.mdwn
diff options
context:
space:
mode:
authordark <dark@web>2010-11-01 20:55:20 +0000
committerJoey Hess <joey@kitenet.net>2010-11-01 20:55:20 +0000
commit69a22a6f4b4dfc47a7ce39476758742036b70e63 (patch)
tree176ddd664ee4555a2bc61de7154060b688523a93 /doc/todo/selective_more_directive.mdwn
parentca166361973e09b6756acbfe46b4a1bcfa4148d7 (diff)
downloadikiwiki-69a22a6f4b4dfc47a7ce39476758742036b70e63.tar
ikiwiki-69a22a6f4b4dfc47a7ce39476758742036b70e63.tar.gz
proposal plus patch
Diffstat (limited to 'doc/todo/selective_more_directive.mdwn')
-rw-r--r--doc/todo/selective_more_directive.mdwn26
1 files changed, 26 insertions, 0 deletions
diff --git a/doc/todo/selective_more_directive.mdwn b/doc/todo/selective_more_directive.mdwn
new file mode 100644
index 000000000..24e6ab568
--- /dev/null
+++ b/doc/todo/selective_more_directive.mdwn
@@ -0,0 +1,26 @@
+I'm setting up a blog for NaNoWriMo and other story-writing, which means long posts every day. I want to have excerpts on the front page, which link to the full length story posts. I also want a dedicated page for each story which inlines the story in full and in chronological order. I can use the "more" directive to achieve this effect on the front page but then it spoils the story page. My solution was to add a pages= parameter to the more directive to make it more selective.
+
+ --- /usr/share/perl5/IkiWiki/Plugin/more.pm 2010-10-09 00:09:24.000000000 +0000
+ +++ .ikiwiki/IkiWiki/Plugin/more.pm 2010-11-01 20:24:59.000000000 +0000
+ @@ -26,7 +26,10 @@
+
+ $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},
+
+I can now call it as
+
+ \[[!more pages="index" linktext="Chapter 1" text="""
+ etc
+ """]]
+
+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]]