RoughingIT

[ Home | RSS 2.0 | ATOM 1.0 ]

Tue, 13 Dec 2011

Hello World!

Hello World. Got pyblosxom set up right. Did have to fight the timezone stuff a bit, and I found that a good solution is to fix it in config.py:

import time, os
os.environ['TZ'] = 'Asia/Singapore'
time.tzset()

I followed the example from th.oughts:todo blog to get a git style setup on this blog, so that I can edit at home, work, etc, and push when I am ready to let the world know.

Changes I did from his code was to just maintain any file timestamps from /entries and also to run the static rendering after the push. It looks more or less, like this:

cat pre-receive 
#!/bin/bash
WD=/home/wari/roughingit/entries
rm -rf accessdata
for filename in `find $WD -type f`; do 
  mtime=`stat -c %y $filename`
  echo "$filename $mtime" >> accessdata
done

cat post-receive
#!/bin/bash
GIT_WORK_TREE=$HOME/roughingit git checkout -f
while read line ; do 
  filename=`echo $line | awk '{print $1}'`
  mtime=`echo $line | awk '{print ""$2"" " " ""$3"" " " ""$4""}'`
  touch -d "$mtime" $filename
done < "accessdata"

. $HOME/pyblosxom/bin/activate
pyblosxom-cmd staticrender --config=/home/wari/roughingit/config.py

And that's all, really. Now, there's a lot more to do, but I'm quite contented, for now.

posted at: 10:53 | path: / | permanent link to this entry

Made with PyBlosxom