Added a comment
[ikiwiki.git] / doc / forum / Blog_posting_times_and_ikiwiki_state.mdwn
1 What I wanted
2 -------------
3
4 I thought to myself it would be nice to see from the console the dates that my ikiwiki blog posts were published.  Especially as I would like to know the order of my todo list without having to view the webpage.
5
6 What I discovered
7 -----------------
8
9 Looked at the code and saw the functions for grabbing the ctime from git but couldn't reconcile them to the "Posted" date in the RSS feed.  Some more reading and I figured out that the Posted time is taken from the UNIX ctime when first uploaded into the repository and this information is stored in the page state via a Perl storable database - indexdb. (I'm sure most know this but to be clear in UNIX ctime is *not* the actual creation time of a file. UNIX has no facility for recording the actual creation time - however on first upload to the wiki it's good enough).
10
11 Wrote a Perl script to query and sort indexdb.  Now I can list my todos or blog posts in the order they appear on the web.  Handy.
12
13 However the ikiwiki state is specifically excluded via '.gitignore'.  I work a lot on trains and not having this file in my cloned wiki means I can't list published posts or my todos in the proper order.  I can get an approximation from git logs but, dam it, I want it the same!
14
15 What can I do?
16 --------------
17
18 Is it a spectacularly bad idea to include the ikiwiki state file in my cloned repo (I suspect it is).  What else could be done?  Can I disable pagestate somehow or force ikiwiki to always use git commit times for Posted times?
19
20 > Have you tried running ikiwiki with the `--gettime` option on your laptop,
21 > to force it to retrieve initial commit times from git? You should only
22 > need to do that once, and it'll be cached in the pagestate thereafter.
23 >
24 > Because that functionality is slow on every supported VCS except git,
25 > ikiwiki tries to avoid using it unless it's really needed. [[rcs]]
26 > lists it as "fast" for git, though, so depending how fast it really is
27 > and how large your wiki is, you might be able to get away with running
28 > ikiwiki with `--gettime` all the time? --[[smcv]]