Code for
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines

  1. ALL_TAGS = $(shell ruby -rutils -rset -I. -e 'print picture_info_hashes.reduce( {|memo, h| memo + h[:tags]}.to_a.join(" ")')
  2. all: tags thumbnails
  3. bundle exec middleman build
  4. tags:
  5. rm -rf source/tag && mkdir source/tag
  6. for tag in $(ALL_TAGS); do mkdir source/tag/$$tag && sed "s/%TAG%/$$tag/g" tag.html.erb >source/tag/$$tag/index.html.erb; done
  7. thumbnails:
  8. rm -f source/content/thumbnails/*.jpg source/content/thumbnails/*.png
  9. for ext in jpg png; do \
  10. for i in source/content/*.$$ext; do convert -define jpeg:size=800x800 $$i -thumbnail 295x380^ -gravity center -extent 295x380 `dirname $$i`/thumbnails/`basename $$i`; done; \
  11. done
  12. sync: all
  13. rsync -r --delete build/
  14. .PHONY: all tags thumbnails sync