]> git.phdru.name Git - phdru.name/phdru.name.git/blobdiff - make-files
Feat(blog): Encode tags
[phdru.name/phdru.name.git] / make-files
index 49d5182896417286bf00c00eb5fbaa7aaa1c9370..a43d782cb4e162ced61786c4d8b33be2e9b3deb9 100755 (executable)
@@ -2,10 +2,20 @@
 
 umask 022
 PYTHONPATH=.
-export PYTHONPATH
+PYTHONIOENCODING=koi8-r:replace
+export PYTHONPATH PYTHONIOENCODING
 
-if [ phd_site.tmpl -nt phd_site.py ]; then
-   cheetah compile --nobackup phd_site.tmpl
-fi
+if [ \! -e phd_site.py -o phd_site.tmpl -nt phd_site.py ]; then
+   python2.7 `which cheetah` compile --encoding=koi8-r --settings='encoding="koi8-r"' --nobackup phd_site.tmpl &&
+   compyle phd_site.py
+fi &&
 
-exec cheetah fill --nobackup "$@"
+for tmpl in "$@"; do
+   dir="`dirname \"$tmpl\"`"
+   outfile="`basename \"$tmpl\" .tmpl`.html"
+   echo "$tmpl => $dir/$outfile"
+   python2.7 `which cheetah` fill --encoding=koi8-r --settings='encoding="koi8-r"' \
+      --nobackup --stdout "$tmpl" | iconv -c -f utf-8 -t koi8-r >"$dir/$outfile" || exit 1
+done
+
+exec sitemap_gen.py --config=sitemaps/phdru.name-config.xml