My personal blog
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.
 
 
 

33 lines
790 B

WINTERSMITH = ./node_modules/.bin/wintersmith
ARTICLE_DIR = ./contents/is/writing/about
build:
@$(WINTERSMITH) build
clean:
@rm -rf build
preview:
@$(WINTERSMITH) preview
add_article:
@echo "Enter Article Title: "
@read title;\
dir=`echo $$title | sed "s/ /-/g"`;\
mkdir -p $(ARTICLE_DIR)/$$dir;\
cat base.md | sed "s/{title}/$$title/g" | sed s/{date}/`date "+%Y-%m-%d"`/g> $(ARTICLE_DIR)/$$dir/index.md;\
emacs $(ARTICLE_DIR)/$$dir/index.md
remove_article:
@echo "Enter Article Title: "
@read title;\
dir=`echo $$title | sed "s/ /-/g"`;\
rm -rf $(ARTICLE_DIR)/$$dir
edit_article:
@echo "Enter Article Title: "
@read title;\
dir=`echo $$title | sed "s/ /-/g"`;\
emacs $(ARTICLE_DIR)/$$dir/index.md
.PHONY: build clean preview add_article remove_article edit_article