From c9160ae83c254d9ef0af9e05fdb05a16d4b2fe6e Mon Sep 17 00:00:00 2001 From: spalax Date: Tue, 14 Jun 2016 11:36:33 -0400 Subject: [PATCH] Added a comment: More thought about the `pageversion` plugin --- ..._5ca8289d6f9d22dfcc4db92e3635bb18._comment | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 doc/forum/Questions_about_a_new_plugin/comment_4_5ca8289d6f9d22dfcc4db92e3635bb18._comment diff --git a/doc/forum/Questions_about_a_new_plugin/comment_4_5ca8289d6f9d22dfcc4db92e3635bb18._comment b/doc/forum/Questions_about_a_new_plugin/comment_4_5ca8289d6f9d22dfcc4db92e3635bb18._comment new file mode 100644 index 000000000..63d38dddd --- /dev/null +++ b/doc/forum/Questions_about_a_new_plugin/comment_4_5ca8289d6f9d22dfcc4db92e3635bb18._comment @@ -0,0 +1,35 @@ +[[!comment format=mdwn + username="spalax" + subject="More thought about the `pageversion` plugin" + date="2016-06-14T15:36:32Z" + content=""" +I like your idea of a pagespec: + + # index.mdwn - assume ... is a glob that matches sismologie but not its subpages + [[!report pages=\"first-trail-member(...)\"]] + +What I have in mind now, assuming that my website have the following structure: + + $ tree + ├── blog.mdwn + └── blog + ├── bar.mdwn + ├── bar + │ ├── 20151108.mdwn + │ └── 20160413.mdwn + ├── foo.mdwn + └── foo + ├── 20160103.mdwn + └── 20160605.mdwn + +I can have a plugin that implements: + +- a directive ``[[!versionof parent]]`` in every *actual* article (`bar/20151108.mdwn`, `bar/20160413`, `foo/20160103`, `foo/20160605`) which does two things: + - it registers the pages as being a version of its parent page; + - it displays a text ``Other versions of this article: ...``. +- 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()]]``; +- 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``)). + +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. + +"""]]