#!/usr/bin/make -f build: #Cleanup common unneeded stuff -find -iname '*.bak' | xargs rm -find -iname 'Thumbs.db' | xargs rm -rm -rf ./_site/__test #Build the site bundler exec jekyll b #Cleanup HTTrack files on output site -find _site/httrack-sites/ -type d -iname hts-cache | xargs -n1 rm -r -find _site/httrack-sites/ -iname cookies.txt | xargs -n1 rm -find _site/httrack-sites/ -iname hts-log.txt | xargs -n1 rm #Stats for nerds touch stats.log # - Posts echo -ne ' ' >> stats.log find _posts/ -type f -iname '*.md' | wc -l | tr -d '\n\t' >> stats.log echo -e '\tPosts' >> stats.log # - All file count echo -ne ' ' >> stats.log find _site/ -type f | wc -l | tr -d '\n\t' >> stats.log echo -e '\tFiles' >> stats.log # - /pics/ file count echo -ne '\t' >> stats.log find _site/pics/ -type f | wc -l | tr -d '\n\t' >> stats.log echo -e '\tPictures' >> stats.log # - /downloads/ file count echo -ne '\t' >> stats.log find _site/downloads/ -type f | wc -l | tr -d '\n\t' >> stats.log echo -e '\tDownloads' >> stats.log # - Files from httrack mirrors echo -ne '\t' >> stats.log find _site/httrack-sites/ -type f | wc -l | tr -d '\n\t' >> stats.log echo -e '\tFiles from mirrors' >> stats.log # - Site size echo -ne ' ' >> stats.log du -h -d0 _site/ | sed 's/M.*/M/' | tr -d '\n\t' >> stats.log echo -e '\tSite size' >> stats.log # - Repo size echo -ne ' ' >> stats.log du -h -d0 .hg/ | sed 's/M.*/M/' | tr -d '\n\t' >> stats.log echo -e '\tRepo size' >> stats.log # - File types echo -ne '\nFile types:\n' >> stats.log find _site/ -type f | grep -o '\.[^\.]*$$' | sort | uniq -c | sort --numeric-sort --reverse >> stats.log #Inject the stats into the misc placeholder # - _site/misc/index.html # - [begin_stats] sed -i -e '/begin_stats/r stats.log' _site/misc/index.html -rm stats.log #gzip compress most file types for nginx gzip_static -find _site/ -iname '*.html' | xargs -n1 gzip -9 -k -f -find _site/ -iname '*.txt' | xargs -n1 gzip -9 -k -f -find _site/ -iname '*.css' | xargs -n1 gzip -9 -k -f -find _site/ -iname '*.xml' | xargs -n1 gzip -9 -k -f -find _site/ -iname '*.svg' | xargs -n1 gzip -9 -k -f -find _site/ -iname '*.tex' | xargs -n1 gzip -9 -k -f -find _site/ -iname '*.pdf' | xargs -n1 gzip -9 -k -f -find _site/ -iname '*.js' | xargs -n1 gzip -9 -k -f drafts: -rm -rf ./_site/__test bundler exec jekyll b --drafts -d ./_site/__test init: bundle init bundle config set --local path 'vendor/bundle' bundle add jekyll bundle add jekyll-feed bundle add minima spellcheck: ./spellcheck.sh