]> sipb.mit.edu Git - ikiwiki.git/blob - doc/todo/feed_enhancements_for_inline_pages.mdwn
bfc7531bb47026846ea4600e9a88038b214d47a4
[ikiwiki.git] / doc / todo / feed_enhancements_for_inline_pages.mdwn
1 [[!template id=gitbranch branch=GiuseppeBilotta/inlinestuff author="Giuseppe Bilotta"]]
2
3 I rearranged my patchset once again, to clearly identify the origin and
4 motivation of each patch, which is explained in the following.
5
6 In my ikiwiki-based website I have the following situation:
7
8 * `$config{usedirs}` is 1
9 * there are a number of subdirectories (A/, B/, C/, etc)
10   with pages under each of them (A/page1, A/page2, B/page3, etc)
11 * 'index pages' for each subdirectory: A.mdwn, B.mdwn, C.mdwn;
12   these are rather barebone, only contain an inline directive for their
13   respective subpages and become A/index.html, etc
14 * there is also the main index.mdwn, which inlines A.mdwn, B.mdwn, C.mdwn,
15   etc (i.e. the top-level index files are also inlined on the homepage)
16
17 With the upstream `inline` plugin, the feeds for A, B, C etc are located
18 in `A/index.atom`, `B/index.atom`, etc; their title is the wiki name and
19 their main link goes to the wiki homepage rather than to their
20 respective subdir (e.g. I would expect `A/index.atom` to have a link to
21 `http://website/A` but it actually points to `http://website/`).
22
23 This is due to them being generated from the main index page, and is
24 fixed by the first patch: ‘inline: base feed urls on included page
25 name’. As explained in the commit message for the patch itself, this is
26 a ‘forgotten part’ from a previous page vs destpage fix which has
27 already been included upstream.
28
29 > Applied. --[[Joey]] 
30
31 >> Thanks.
32
33 The second patch, ‘inline: improve feed title and description
34 management’, aligns feed title and description management by introducing
35 a `title` option to complement `description`, and by basing the
36 description on the page description if the entry is missing. If no
37 description is provided by either the directive parameter or the page
38 metadata, we use a user-configurable default based on both the page
39 title and wiki name rather than hard-coding the wiki name as description.
40
41 > Reviewing, this seems ok, but I don't like that 
42 > `feed_desc_fmt` is "safe => 0". And I question if that needs
43 > to be configurable at all. I say, drop that configurable, and
44 > only use the page meta description (or wikiname for index).
45
46 > Oh, and could you indent your `elsif` the same as I? --[[Joey]] 
47
48 >> I hadn't even realized that I was nesting ifs inside else clauses,
49 >> sorry. I think you're also right about the safety of the key, after
50 >> all it only gets interpolated with known, safe strings.
51
52 >> The question is what to do for pages that do not have a description
53 >> (and are not the index). With your proposal, the Atom feed subtitle
54 >> would turn up empty. We could make it conditional in the default
55 >> template, or we could have `$desc` default to `$title` if nothing
56 >> else is provided, but at this point I see no reason to _not_ allow
57 >> the user to choose a way to build a default description.
58
59 The third patch, ‘inline: allow assigning an id to postform/feedlink’,
60 does just that. I don't currently use it, but it can be particularly
61 useful in the postform case for example for scriptable management of
62 multiple postforms in the same page.
63
64 > Applied. --[[Joey]] 
65
66 >> Thanks.
67
68 In one of my wiki setups I had a terminating '/' in `$config{url}`. You
69 mention that it should not be present, but I have not seen this
70 requirement described anywhere. Rather than restricting the user input,
71 I propose a patch that prevents double slashes from appearing in links
72 created by `urlto()` by fixing the routine itself.
73
74 > If this is fixed I would rather not put the overhead of fixing it in
75 > every call to `urlto`. And I'm not sure this is a comprehensive
76 > fix to every problem a trailing slash in the url could cause. --[[Joey]]
77
78 >> Maybe something that sanitizes the config value would be better instead?
79 >> What is the policy about automatic changing user config?
80
81 The inline plugin is also updated (in a separate patch) to use `urlto()`
82 rather than hand-coding the feed urls. You might want to keep this
83 change even if you discard the urlto patch.
84
85 > IIRC, I was missing a proof that this always resulted in identical urls,
86 > which is necessary to prevent flooding. I need such a proof before I can
87 > apply that. --[[Joey]] 
88
89 >> Well, the URL would obviously change if the `$config{url}` ended in
90 >> slash and the `urlto` patch (or other equivalent) went into effect.
91
92 >> Aside from that, if I read the code correctly, the only other extra
93 >> thing that `urlto` does is to `beautify_url_path` the `"/".$to` part,
94 >> and the only way this would cause the url to be altered is if the
95 >> feed name was "index" (which can easily happen) and
96 >> `$config{htmlext}` was set to something like `.rss` or
97 >> `.rss.1`.
98
99 >> So there is a remote possibility that a different URL would be
100 >> produced.