# haqistan.net OS!=uname .if ${OS} == Linux .SHELL: name=ksh path=/bin/ksh .endif AUTHOR=attila MULTIMARKDOWN?=multimarkdown flags?= # make flags=-d site ... FLOG_FLAGS?=-BP -A "${AUTHOR}" ${flags} FLOG?=./flog.pl ${FLOG_FLAGS} #FLOG?=flog ${FLOG_FLAGS} PERLDOC?=perldoc SH?=/bin/ksh RM?=rm BASE?=./tmp .if ${OS} == Linux TAR?=tar .else TAR?=gtar .endif VHOST_branch!=git branch --no-color | fgrep '*' | awk '{print $$2}' VHOST_trunk?=www.haqistan.net VHOST_master?=www.haqistan.net VHOST_staging?=flog.haqistan.net VHOST_flogger?=flogger VHOST_local?=flogger VHOST_?=${VHOST_branch} VHOST?=${VHOST_${VHOST_}} .if ${OS} == Linux DOCROOT_ROOT=/var/www .else DOCROOT_ROOT?=/var/www/htdocs .endif DOCROOT=${DOCROOT_ROOT}/${VHOST} #DOCROOT_trunk?=${DOCROOT_ROOT}/www.haqistan.net #DOCROOT_master?=${DOCROOT_ROOT}/www.haqistan.net #DOCROOT_staging?=${DOCROOT_ROOT}/flog.haqistan.net #DOCROOT_flogger?=${DOCROOT_ROOT}/flogger #DOCROOT=${DOCROOT_${VHOST}} WEB_BUG?=fnrd.gif STATIC=flogger.css flogger-draft.css meta.md header.md footer.md flog.pl \ dump_wordpress.pl robots.txt Makefile ${WEB_BUG} images haqistan.png fontz CP?=cp CONTENT_DIRS?=pages posts papers books ECHO?=/bin/echo '... ' grep_opts?=-i # OpenBSD-style make show=foo .if defined(show) .MAIN: show .elif defined(search) .MAIN: search .elif defined(find) .MAIN: find .else .MAIN: all .endif all: ${BASE} static ${BASE}/index.md mung-archives-index # make show=draft, make show=featured, ... searches metadata show: .for _s in ${show} . for _d in ${CONTENT_DIRS} -@find ${_d} -name '*.md' | xargs grep ${grep_opts} '^${_s}:' . endfor .endfor # search contents by regexp search: .for _t in ${search} . for _d in ${CONTENT_DIRS} -@find ${_d} -name '*.md' | xargs grep ${grep_opts} ${_t} . endfor .endfor # search filenames by find(1)/glob(7) pattern find: .for _f in ${find} . for _d in ${CONTENT_DIRS} -@find ${_d} -name "${_f}" . endfor .endfor ${BASE}: mkdir -p ${BASE} static: flog.html @${ECHO} Copying Static Content @-${TAR} -cf - ${STATIC} flog.html | ${TAR} -C ${BASE} -xf - flog.html: flog.pl @${ECHO} Regenerating flog POD @${PERLDOC} -o html flog.pl > flog.html @-${RM} -f tmp.sed @echo '3i\\' > tmp.sed @echo '' >> tmp.sed @sed -i -f tmp.sed flog.html $(BASE)/index.md: # ${FLOG} -D ${BASE} | ${SH} @${ECHO} "Generating Site ..." @/bin/echo -n '... ' @-time ${FLOG} | ${SH} clean: @-${RM} -f flog.html tmp.sed @-[ -d ${BASE} ] && ${RM} -rf ${BASE}/* site: clean all update: site @${ECHO} Copying to docroot: ${DOCROOT} @-${TAR} -C ${BASE} -cf - . | ${TAR} -C ${DOCROOT} -xf - update-cmd: @echo "# "BASE=${BASE} BRANCH=${BRANCH} DOCROOT=${DOCROOT} @echo '${TAR} -C ${BASE} -cf - . | ${TAR} -C ${DOCROOT} -xf -' # SKULDUGGERY alert # # Multimarkdown gets upset about embedded HTML
tags. Instead, # we leave HTML comments for ourselves in flog.pl and whack them into # proper divs post-HTML: gross but effective. The tags archive really # needs a multicol layout or it's too long and confusing. # # Of course this depends on .twocol/.threecol being handled properly in # your CSS. Something like: # div.twocol { # column-count: 2; # -webkit-column-count: 2; /* Chrome, Safari, Opera */ # -moz-column-count: 2; /* Firefox */ # line-height: 1.1; # } # div.threecol { # column-count: 3; # -webkit-column-count: 3; /* Chrome, Safari, Opera */ # -moz-column-count: 3; /* Firefox */ # line-height: 1.1; # } # mung-archives-index: @sed -i -e 's,,
,' \ -e 's,,
,' \ -e 's,,
,' \ -e 's,,
,' \ ${BASE}/archives/index.html