Makefile - www.codemadness.org - www.codemadness.org saait content files
 (HTM) git clone git://git.codemadness.org/www.codemadness.org
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
       Makefile (2462B)
       ---
            1 .POSIX:
            2 
            3 generate: markdown sfeeddoc
            4         mkdir -p output/phlog/
            5         cp style.css print.css output/
            6         # sort pages by "creation" date variable (descending),
            7         # process files in this order for the index and Atom feed.
            8         # assumes there are no newlines in filenames.
            9         awk 'BEGIN { FS = "="; OFS = "\t"; } /^created[ ]*=[ ]*/{ gsub(/^[ ]*/, "", $$2); print $$2 OFS FILENAME; }' pages/*.cfg | \
           10                 sort -r -t '        ' -k1,1r | \
           11                 cut -d '        ' -f 2- | \
           12                 tr '\n' '\0' | \
           13                 xargs -0 saait
           14         # Atom to JSON Feed 1.1
           15         sfeed < output/atom.xml | sfeed_json > output/jsonfeed.json
           16         sfeed < output/atom_content.xml | sfeed_json > output/jsonfeed_content.json
           17         sfeed < output/atom_gopher.xml | sfeed_json > output/jsonfeed_gopher.json
           18         sfeed < output/atom_content_gopher.xml | sfeed_json > output/jsonfeed_content_gopher.json
           19         # raw sfeed
           20         sfeed < output/atom.xml > output/sfeed.tsv
           21         sfeed < output/atom_content.xml > output/sfeed_content.tsv
           22         sfeed < output/atom_gopher.xml > output/sfeed_gopher.tsv
           23         sfeed < output/atom_content_gopher.xml > output/sfeed_content_gopher.tsv
           24 
           25         # Atom feed page
           26         saait -t feeds/templates feeds/pages/atom.cfg
           27         # move index.gopher to index.
           28         mv output/index.gopher output/index
           29 
           30 draft:
           31         rm -rf /tmp/www-drafts
           32         mkdir -p /tmp/www-drafts
           33         cp style.css /tmp/www-drafts
           34         saait -c config.cfg -o /tmp/www-drafts draft/*.cfg
           35 
           36 sfeeddoc:
           37         # sfeed format documentation
           38         mandoc -Ios="Some OS 1.0" -Tutf8 sfeed.1 | col -b > output/sfeed.1.txt
           39         mandoc -Ios="Some OS 1.0" -Thtml sfeed.1 > output/sfeed.1.html
           40 
           41 md2gopher:
           42         scripts/markdowntogopher.sh
           43 
           44 md2html:
           45         # copy Markdown/plain-text files and post-process to make absolute URLs.
           46         scripts/markdowntohtml.sh
           47 
           48 markdown: md2gopher md2html
           49 
           50 checkhtml:
           51         # for the "checkhtml" tool, see the repo randomcrap/checkhtml.c
           52         find pages -type f -name "*.html" -print0 | xargs -t -0 -I{} -n1 sh -c 'checkhtml -x < {}'
           53         find feeds/pages -type f -name "*.html" -print0 | xargs -t -0 -I{} -n1 sh -c 'checkhtml -x < {}'
           54         # check Atom and RSS feeds.
           55         find output -maxdepth 1 -type f -name "*.xml" -print0 | xargs -t -0 -I{} -n1 sh -c 'checkhtml -x < {}'
           56 
           57 checkgopher:
           58         find output/phlog -maxdepth 1 -type f -print0 | xargs -t -0 -I{} -n1 sh -c 'gopher-validator < {}'
           59 
           60 check: checkhtml checkgopher
           61 
           62 view:
           63         $(BROWSER) output/index.html
           64 
           65 bump:
           66         sed -Ei "s@^(siteupdated = ).*@\1`date +'%Y-%m-%d'`@" config.cfg
           67 
           68 sync: check
           69         rsync -av output/ hiltjo@cow:/home/www/domains/www.codemadness.org/htdocs/
           70 
           71 .PHONY: check draft generate view sync