3 # This file is a part of phdru.name homepage/blog/news generator scripts.
5 # __author__ = "Oleg Broytman <phd@phdru.name>"
6 # __copyright__ = "Copyright (C) 2006-2017 PhiloSoft Design"
9 .SUFFIXES: # Clear the suffix list
10 .SUFFIXES: .py .tmpl .html
14 umask 022; python2.7 `which cheetah` compile --encoding=koi8-r --settings='encoding="koi8-r"' --nobackup $< && compyle $@ && chmod +x $@
16 %.html: %.tmpl phd.py phd_site.py
17 umask 022; PYTHONPATH=. PYTHONIOENCODING=koi8-r:replace python2.7 `which cheetah` fill --encoding=koi8-r --settings='encoding="koi8-r"' --nobackup --stdout $< | iconv -c -f utf-8 -t koi8-r >$@
33 blog: phd.py phd_site.py atom_10.py rss_20.py
38 allfiles = $(shell find ../htdocs/phdru.name -type f ! -name sitemap.xml -print)
39 templates = $(shell find ../htdocs/phdru.name -type f -name \*.tmpl -print)
40 htmls = $(patsubst %.tmpl,%.html,$(templates))
43 html: phd.py phd_site.py $(htmls) special-templates sitemap
47 news: atom_10.py rss_20.py
48 (umask 022; PYTHONPATH=. ./make-news.py en ../htdocs/phdru.name && ./make-news.py ru ../htdocs/phdru.name/Russian)
51 SITEMAP = ../htdocs/phdru.name/sitemap.xml
56 $(SITEMAP): $(allfiles) sitemaps/phdru.name-config.xml
57 sitemap_gen.py --config=sitemaps/phdru.name-config.xml
60 .PHONY: special-templates
61 special-templates: ../htdocs/phdru.name/Russian/Software/instant-messengers/instant-messengers-lj.html ../htdocs/phdru.name/Russian/remote-work-bio/remote-work-bio-lj.html ../htdocs/phdru.name/Russian/remote-work-bio/remote-work-bio2-lj.html
63 ../htdocs/phdru.name/Russian/Software/instant-messengers/instant-messengers-lj.html: ../htdocs/phdru.name/Russian/Software/instant-messengers/instant-messengers.html
64 { sed -e '1,/alink="#ff0000">/d' \
65 -e 's/<div class="section" id="icq">/<lj-cut text="IM">&/' \
66 -e '/<hr width="90%">/,$$d' $< | sed '1,2d'; \
67 echo '</lj-cut>'; } >$@
69 ../htdocs/phdru.name/Russian/remote-work-bio/remote-work-bio-lj.html: ../htdocs/phdru.name/Russian/remote-work-bio/remote-work-bio.html
70 { sed -e '1,/alink="#ff0000">/d' \
71 -e 's/<div class="section" id="i">/<lj-cut text="АвтоБио...">&/' \
72 -e '/<hr width="90%">/,$$d' $< | sed '1,2d'; \
73 echo '</lj-cut>'; } >$@
75 ../htdocs/phdru.name/Russian/remote-work-bio/remote-work-bio2-lj.html: ../htdocs/phdru.name/Russian/remote-work-bio/remote-work-bio2.html
76 { sed -e '1,/alink="#ff0000">/d' \
77 -e 's/<div class="section" id="ii">/<lj-cut text="Никто не обещал райского сада...">&/' \
78 -e '/<hr width="90%">/,$$d' $< | sed '1,2d'; \
79 echo '</lj-cut>'; } >$@