3 subject="I'm not so sure that copying metadata is desirable"
4 date="2016-06-09T15:09:30Z"
6 I'm not so sure that copying metadata around is the right solution to the
7 use case that you outlined. If you do that, then `/doc/v2.0/` and `/doc/` will
8 be indistinguishable anywhere that pages are listed by their metadata - it's as
9 though you'd copied the text content of `doc/v2.0.mdwn` into `doc.mdwn`. For
10 example, if it's tagged `readme`, then a list of pages matching `tagged(readme)`
11 will have two apparently identical entries, one of which is `/doc/` and the other
14 Why not do this instead?
19 [[!meta title=\"Foobar documentation, version 2.0\"]]
21 [[!if test=\"doc/* and created_after(.)\" all=\"no\"
22 then=\"\"\"[[!template id=\"note\" text=\"[Newer versions are available|doc]\"]]\"\"\"]]
24 Here is new documentation about Foobar.
28 [[!meta title=\"Foobar documentation, version 1.0\"]]
30 [[!if test=\"doc/* and created_after(.)\" all=\"no\"
31 then=\"\"\"[[!template id=\"note\" text=\"[Newer versions are available|doc]\"]]\"\"\"]]
33 Here is documentation about Foobar.
36 [[!meta title=\"Foobar documentation\"]]
37 [[!inline pages=\"doc/*\" limit=\"1\" sort=\"age\" feeds=\"no\" actions=\"no\" raw=\"yes\"]]
41 [[!inline pages=\"doc/*\" skip=\"1\" archive=\"yes\"]]
44 ... or even (with a bit of new code)
48 [[!meta redir_first_match=\"doc/*\" sort=\"age\"]]
51 In real life you'd probably want to use a special `[[!template]]` for the link
52 to the latest version, so that it's easier to make them all consistent, but
53 for those examples I'm just using the standard [[templates/note]] and some markup.
55 > this is not my usecase, but it matches exactly
57 Why not ask us about your real use-case, in case it turns out that it *doesn't*
58 match exactly after putting more thought into it? :-)