]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blob - doc/forum/Questions_about_a_new_plugin/comment_4_5ca8289d6f9d22dfcc4db92e3635bb18._comment
Added a comment: More thought about the `pageversion` plugin
[git.ikiwiki.info.git] / doc / forum / Questions_about_a_new_plugin / comment_4_5ca8289d6f9d22dfcc4db92e3635bb18._comment
1 [[!comment format=mdwn
2  username="spalax"
3  subject="More thought about the `pageversion` plugin"
4  date="2016-06-14T15:36:32Z"
5  content="""
6 I like your idea of a pagespec:
8     # index.mdwn - assume ... is a glob that matches sismologie but not its subpages
9     [[!report pages=\"first-trail-member(...)\"]]
11 What I have in mind now, assuming that my website have the following structure:
13     $ tree
14     ├── blog.mdwn
15     └── blog
16         ├── bar.mdwn
17         ├── bar
18         │   ├── 20151108.mdwn
19         │   └── 20160413.mdwn
20         ├── foo.mdwn
21         └── foo
22             ├── 20160103.mdwn
23             └── 20160605.mdwn
25 I can have a plugin that implements:
27 - a directive ``[[!versionof parent]]`` in every *actual* article (`bar/20151108.mdwn`, `bar/20160413`, `foo/20160103`, `foo/20160605`) which does two things:
28   - it registers the pages as being a version of its parent page;
29   - it displays a text ``Other versions of this article: ...``.
30 - a pagespec function ``latestversion``, so that the ``blog.mdwn`` page can list the last version of each article using something like ``[[!report pages=\"*/* and latestversion()]]``;
31 - a directive ``[[!redir_to_latest_version]]`` (or a nicer, shorter name) in *'meta'* articles (`foo.mdwn`, `bar.mdwn`), which redirects the page to the latest version of the article (so that ``http://example.com/blog/foo`` redirects to ``http://example.com/blog/foo/20160605`` (the latest version of ``foo``)).
33 Anyway, thank you very much: it may not be the definitive form yet, but it is already much more clean than it was at the beginning.
35 """]]