feat: Add new-post
Makefile target to generate blog posts
This commit is contained in:
parent
205a242ef4
commit
fa44f4eb7d
1 changed files with 16 additions and 1 deletions
17
Makefile
17
Makefile
|
@ -1,4 +1,19 @@
|
||||||
.PHONY: server
|
.PHONY: server new-post
|
||||||
|
|
||||||
server:
|
server:
|
||||||
hugo server
|
hugo server
|
||||||
|
|
||||||
|
new-post:
|
||||||
|
@YEAR=$$(date +%Y); \
|
||||||
|
MONTH=$$(date +%m); \
|
||||||
|
DAY=$$(date +%d); \
|
||||||
|
POST_DIR="content/blog/$$YEAR/$$MONTH/$$DAY/dummy"; \
|
||||||
|
mkdir -p "$$POST_DIR"; \
|
||||||
|
echo "+++" > "$$POST_DIR/index.md"; \
|
||||||
|
echo "title = Dummy Post" >> "$$POST_DIR/index.md"; \
|
||||||
|
echo "date = $$(date +%Y-%m-%d)" >> "$$POST_DIR/index.md"; \
|
||||||
|
echo "draft = false" >> "$$POST_DIR/index.md"; \
|
||||||
|
echo "+++" >> "$$POST_DIR/index.md"; \
|
||||||
|
echo "" >> "$$POST_DIR/index.md"; \
|
||||||
|
echo "Content goes here" >> "$$POST_DIR/index.md"; \
|
||||||
|
echo "Created new post at $$POST_DIR/index.md"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue