Done updating
author |
Steve Losh <steve@stevelosh.com> |
date |
Thu, 03 Aug 2017 22:49:14 -0400 |
parents |
6e60d0b96c6e |
children |
344fc7b12455 |
.PHONY: clean generate serve deploy css
files := $(shell hg files)
less := $(shell ffind --literal '.less')
style := $(subst .less,.css,$(less))
photos := $(shell ffind 'static/media/images/photography/photos/.*/.*.jpg' --entire)
thumbs := $(subst photos,thumbnails,$(photos))
THUMBNAIL_CMD = convert $< -resize "200^>" -gravity center -crop 200x200+0+0 -strip $@
# Main ------------------------------------------------------------------------
public/index.html: $(files) $(style)
hugo -t stevelosh
generate: public/index.html
clean:
rm -rf public
serve:
hugo server -t stevelosh -D
deploy: public/index.html
rsync -avz ./public/ sl:/var/www/stevelosh.com
# CSS -------------------------------------------------------------------------
css: $(style)
static/media/css/%.css: static/media/css/%.less
lessc $< > $@
# Image Gallery Hell ----------------------------------------------------------
thumbnails: $(thumbs)
static/media/images/photography/thumbnails/plants/%.jpg: static/media/images/photography/photos/plants/%.jpg
$(THUMBNAIL_CMD)
static/media/images/photography/thumbnails/scotland/%.jpg: static/media/images/photography/photos/scotland/%.jpg
$(THUMBNAIL_CMD)
static/media/images/photography/thumbnails/iceland/%.jpg: static/media/images/photography/photos/iceland/%.jpg
$(THUMBNAIL_CMD)
static/media/images/photography/thumbnails/dancing/%.jpg: static/media/images/photography/photos/dancing/%.jpg
$(THUMBNAIL_CMD)