]> sipb.mit.edu Git - ikiwiki.git/blob - doc/todo/sortbylastcomment_plugin.mdwn
wishlist: ask about using ikiwiki as ML
[ikiwiki.git] / doc / todo / sortbylastcomment_plugin.mdwn
1 This plugin provides the `last_comment` [[ikiwiki/pagespec/sorting]] order which uses the modification time of their last comment to sort pages. It also updates the mtime of the page to this value.
2
3 For example, it could be useful to make active threads of discussion appear on top of the list of threads in a forum.
4
5 You'll find it in this repository, in the 'sortbylastcomment' branch:
6
7 <https://un.poivron.org/~sajolida/ikiwiki.git/>
8
9 [[!tag wishlist patch]]
10
11 > Reviewed, tested: looks good to me. We need it for the [Tails forum](https://tails.boum.org/forum/). --[[intrigeri]]
12
13 >> Hi, is there a chance of seeing this plugin getting included in a release at any point soon? --sajolida
14
15 >>> (Reviewing, better late than never...)
16 >>>
17 >>> It seems really non-obvious to me that the mtime of a page is
18 >>> updated as a side-effect of sorting. I think it might also happen too
19 >>> late for it to have the desired effect: mtimes should be updated before
20 >>> the build phase starts, but sorting happens during the build phase.
21 >>>
22 >>> If we had a solution for [[!debbug 479371]] - copying
23 >>> the mtime from child pages to a parent page - then it would
24 >>> be enough to configure the forum threads to inherit the mtime
25 >>> of their comments, and then sorting by mtime would do what
26 >>> you wanted. The remaining problem would be to have a page pick up the
27 >>> most recent mtime from a somewhat configurable set of pages. If the page
28 >>> selection is done by pagespec, then by the time those can be matched
29 >>> deterministically, it's also too late to be getting the desired
30 >>> effect from changing mtimes... so perhaps this is a non-starter.
31 >>>
32 >>> Alternatively, perhaps just doing the sorting, and updating some
33 >>> displayable last-update counter that is not the mtime, would be OK?
34 >>> --[[smcv]]