diff options
author | Jon Dowland <jon@ncl.ac.uk> | 2009-04-02 16:15:41 +0100 |
---|---|---|
committer | Jon Dowland <jon@ncl.ac.uk> | 2009-04-02 16:15:41 +0100 |
commit | e215d023e6e8ca672a77220f3e39904b28fba296 (patch) | |
tree | a5ba287d974c9b49bb38aea92bc2d87e1a08984b /doc/forum | |
parent | a24a669cabb9475e2e4bddb588ef15b51d73d376 (diff) |
example script
Diffstat (limited to 'doc/forum')
-rw-r--r-- | doc/forum/How_does_ikiwiki_remember_times__63__.mdwn | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/doc/forum/How_does_ikiwiki_remember_times__63__.mdwn b/doc/forum/How_does_ikiwiki_remember_times__63__.mdwn index 0e771cd0d..3da37f3d4 100644 --- a/doc/forum/How_does_ikiwiki_remember_times__63__.mdwn +++ b/doc/forum/How_does_ikiwiki_remember_times__63__.mdwn @@ -58,3 +58,31 @@ Do I have it right? > > > > normally lose the times also. (And in that case I think both times are irretrievable, even by > > > > `--getctime`). I might start using a simple script to make blog posts that creates a file for > > > > me, puts today's date in the file as a meta, and opens the file in my editor. -- [[seanh]] + +>>>>> I use a script that does that and also sets up templates and tags +>>>>> for a new item: + + #!/bin/sh + set -u + set -e + + if [ $# -ne 1 ]; then + echo usage: $0 pagename >&2 + exit 1 + fi + + pagename="$1" + + if [ -e "$pagename" ]; then + echo error: "$pagename" exists >&2 + exit 1 + fi + + date=$(date) + echo '[[!template id=draft]]' >> "$pagename" + echo "[[!meta date=\"$date\"]]" >> "$pagename" + echo "[[!tag draft]]" >> "$pagename" + git add "$pagename" + $EDITOR "$pagename" + +>>>>> -- [[Jon]] |