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.
blog/Makefile

57 lines
1.6 KiB

1 year ago
VERSION := $(shell git rev-parse --abbrev-ref HEAD)
GOBIN = $(shell go env GOPATH)/bin
.PHONY: serve
serve: assets
@hugo server -D --log -w --bind 0.0.0.0
.PHONY: new-post
new-post:
@hugo new posts/$(TITLE).md
.PHONY: build
build:
docker build -t vdhsn/blog:${VERSION} -f Dockerfile .
.PHONY: clean build
publish: clean build
docker push vdhsn/blog:${VERSION}
.PHONY: test-publish
test-publish: build
docker run -it -p 8080:80 vdhsn/blog:${VERSION}
.PHONY: clean
clean:
@rm -rf ./public ./resources ./themes ./assets/css/syntax.* ./layouts/partials/single/footer.html
OPENRING_BIN = $(GOBIN)/openring
$(OPENRING_BIN):
go install git.sr.ht/~sircmpwn/openring@latest
public: ./themes/lines/config.toml ./assets/css/syntax.light.css ./assets/css/syntax.dark.css ./layouts/partials/single/footer.html
hugo --verbose --gc --minify --templateMetrics --templateMetricsHints --enableGitInfo --environment production
./themes/lines/config.toml:
@git submodule update --init
./assets/css:
@mkdir -p ./assets/css
./assets/css/syntax.light.css: $(HUGO_BIN) ./assets/css
@hugo gen chromastyles --style=github > assets/css/syntax.light.css
./assets/css/syntax.dark.css: $(HUGO_BIN) ./assets/css
@hugo gen chromastyles --style=github-dark > assets/css/syntax.dark.css
./layouts/partials/single/footer.html: $(OPENRING_BIN)
@mkdir -p ./layouts/partials/single/
$(OPENRING_BIN) \
-s https://dave.cheney.net/feed/atom \
-s https://tech.davis-hansson.com/index.xml \
-s https://blog.benjojo.co.uk/rss.xml \
-s https://drewdevault.com/feed.xml \
< ./assets/openring.in.html \
> ./layouts/partials/single/footer.html