]> sipb.mit.edu Git - ikiwiki.git/blob - doc/todo/tagging_with_a_publication_date.mdwn
Merge branch 'master' of ssh://git.ikiwiki.info/srv/git/ikiwiki.info
[ikiwiki.git] / doc / todo / tagging_with_a_publication_date.mdwn
1 Feature idea: I'd like to be able to tag pages in an ikiwiki blog with a
2 publication date, and have the option of building a blog that excludes
3 publication dates in the future.  (meta pubdate= ?)
4
5 I'm using ikiwiki on git for a "tip of the day" RSS feed, and I'd like to
6 be able to queue up a bunch of items instead of literally putting in one
7 tip per day.  In the future I think this will come in handy for other
8 Mainstream Media-oriented requirements such as "embargo dates" and "editor
9 on vacation".
10
11 > The problem with implementing a feature like this is that, since ikwiiki
12 > is a wiki compiler, if something causes content to change based on the
13 > date, then the wiki needs to be rebuilt periodically. So you'd need a
14 > cron job or something.
15 >
16 > Thinking about this some more, if you're going to have a cron job, you
17 > could just set up a branch containing the future post. The branch could
18 > have a name like 20080911. Then have the cron job git merge the day's
19 > branch, if any, into master each day. And voila, post is completly hidden
20 > until published. You'd want to avoid merge conflicts in your cron job ..
21 > but they'd be unlikely if you limited yourself to just adding new
22 > pages. Alternatively, for larger organisations wishing to deploy more
23 > sweeping changes on a given date, replace cron job with intern.. ;-)
24 > --[[Joey]]
25
26 > > Good approach if you have one day on which a big change goes through, but
27 > > often the reason for tagging with a publication date is so that you can
28 > > dribble out articles one per day when you're gone for a week.  Branches are easy
29 > > in git, but it would still be an extra step to switch branches every time
30 > > you edit a different day's article.
31 > >
32 > > And just to make it a little harder, some sites might want an internal 
33 > > copy of the wiki that _does_ build the future pages, just tags them with the publication
34 > > date, for previewing.
35 > > 
36 > > One more reason to have publication date: if you move a page from your old CMS to ikiwiki
37 > > and want to have it show up in the right order in RSS feeds.
38 > >
39 > > I no longer have the original wiki for which I wanted this feature, but I can
40 > > see using it on future ones. -- [[DonMarti]]
41
42 >>> FWIW, for the case where one wants to update a site offline,
43 >>> using an ikiwiki instance on a laptop, and include some deffered
44 >>> posts in the push, the ad-hoc cron job type approach will be annoying.
45 >>> 
46 >>> In modern ikiwiki, I guess the way to accomplish this would be to
47 >>> add a pagespec that matches only pages posted in the present or past.
48 >>> Then a page can have its post date set to the future, using meta date,
49 >>> and only show up when its post date rolls around.
50 >>> 
51 >>> Ikiwiki will need to somehow notice that a pagespec began matching
52 >>> a page it did not match previously, despite said page not actually
53 >>> changing. I'm not sure what the best way is. 
54 >>>
55 >>> * One way could be to 
56 >>>   use a needsbuild hook and some stored data about which pagespecs
57 >>>   exclude pages in the future. (But I'm not sure how evaluating the
58 >>>   pagespec could lead to that metadata and hook being set up.) 
59 >>> * Another way would be to use an explicit directive to delay a
60 >>>   page being posted. Then the directive stores the metadata and
61 >>>   sets up the needsbuild hook.
62 >>> * Another way would be for ikiwiki to remember the last 
63 >>>   time it ran. It could then easily find pages that have a post
64 >>>   date after that time, and treat them the same as it treats actually
65 >>>   modified files.  Or a plugin could do this via a needsbuild hook,
66 >>>   probably. (Only downside to this is it would probably need to do
67 >>>   a O(n) walk of the list of pages -- but only running an integer
68 >>>   compare per page.)
69 >>> 
70 >>> You'd still need a cron job to run ikiwiki -refresh every hour, or
71 >>> whatever, so it can update. --[[Joey]]