-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
28 lines (25 loc) · 815 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
.PHONY: new build deploy run
empty:=
space:=$(empty) $(empty)
TITLE=$(subst $(space),-,$(T))
DATE=$(shell date +%Y-%m-%d)
new:
mkdir -p contents/articles/$(TITLE);\
echo "---" > contents/articles/$(TITLE)/index.md;\
echo 'title: $(T)' >> contents/articles/$(TITLE)/index.md;\
echo 'author: Kris' >> contents/articles/$(TITLE)/index.md;\
echo 'date: $(DATE)' >> contents/articles/$(TITLE)/index.md;\
echo 'template: article.jade' >> contents/articles/$(TITLE)/index.md;\
echo 'tags: 原创' >> contents/articles/$(TITLE)/index.md;\
echo '---' >> contents/articles/$(TITLE)/index.md;\
vim contents/articles/$(TITLE)/index.md
run:
wintersmith preview
build:
wintersmith build
deploy: build
@echo "Starting to deploy to Github..."
cd build;\
git add .;\
git commit -am "New article: $(T)";\
git push