Created
December 16, 2013 19:53
-
-
Save drscream/7993238 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REMOTE ?= "tm@frubar:~/htdocs" | |
TOPIC ?= "New-Post" | |
DATE ?= "$(shell date --rfc-3339='seconds')" | |
FILE = "$(shell echo "+./_drafts/$(TOPIC).md" | sed -e y/\ /-/ | tr A-Z a-z)" | |
help: | |
@echo 'Makefile for a jekyll web site ' | |
@echo ' ' | |
@echo 'Usage: ' | |
@echo ' make new create new blog entry based on template ' | |
@echo ' make clean remove the generated files ' | |
@echo ' make build (re)generate the web site ' | |
@echo ' make push upload the web site via rsync+ssh ' | |
@echo ' make deploy generate using production settings ' | |
@echo ' make serve serve site at http://localhost:8000 ' | |
@echo ' ' | |
@echo 'Variables: ' | |
@echo ' REMOTE=$(REMOTE) ' | |
@echo ' TOPIC=$(TOPIC) ' | |
@echo ' DATE=$(DATE) ' | |
@echo ' FILE=$(FILE) ' | |
@echo ' ' | |
new: | |
echo "---" >> $(FILE) | |
echo "title: $(TOPIC)" >> $(FILE) | |
echo "layout: post" >> $(FILE) | |
echo "date: $(DATE)" >> $(FILE) | |
echo "published: false" >> $(FILE) | |
echo "---" >> $(FILE) | |
clean: | |
rm -r _site/* | |
build: | |
jekyll build | |
push: | |
rsync --archive --compress --delete _site/* $(REMOTE) | |
deploy: build push | |
serve: | |
jekyll serve --drafts --watch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment