# renovate: datasource=github-releases depName=thegeeklab/hugo-geekblog
THEME_VERSION := v0.27.0
THEME := hugo-geekblog
BASEDIR := .
THEMEDIR := $(BASEDIR)/themes
YEAR := $(shell date +"%Y")

.PHONY: all
all: doc

.PHONY: doc
doc: doc-assets

.PHONY: doc-assets
doc-assets:
	mkdir -p $(THEMEDIR)/$(THEME)/ ; \
	curl -sSL "https://github.com/thegeeklab/$(THEME)/releases/download/${THEME_VERSION}/$(THEME).tar.gz" | tar -xz -C $(THEMEDIR)/$(THEME)/ --strip-components=1

.PHONY: clean
clean:
	rm -rf $(THEMEDIR)

.PHONY: hugo-new
hugo-new:
	hugo new posts/$(YEAR)/$(title)/index.md ; \
	mkdir -p content/posts/$(YEAR)/$(title)/images
