diff options
author | Gabriel A. Giovanini <mail@gabrielgio.me> | 2024-05-26 23:07:42 +0200 |
---|---|---|
committer | Gabriel A. Giovanini <mail@gabrielgio.me> | 2024-05-26 23:07:42 +0200 |
commit | 60e8e751c76d949a28eefe0c5462e0cf17337217 (patch) | |
tree | 59eaf44623710c7031dd3930b8d7bbdcde1b5d9d /Makefile | |
parent | e991b497e8433ee207e597b17f0b7daa3a0e0f26 (diff) | |
download | cerrado-60e8e751c76d949a28eefe0c5462e0cf17337217.tar.gz cerrado-60e8e751c76d949a28eefe0c5462e0cf17337217.tar.bz2 cerrado-60e8e751c76d949a28eefe0c5462e0cf17337217.zip |
feat: Add slug to build
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -1,5 +1,10 @@ -build: sass tmpl - go build -o bin/cerrado +COMMIT := $(shell git rev-parse --short HEAD) +LDFLAGS := "-X 'git.gabrielgio.me/cerrado/templates.Slug=.$(COMMIT)' -s -w" + +build: sass-slug tmpl + go build \ + -ldflags=$(LDFLAGS) \ + -o bin/cerrado run: sass tmpl go run . @@ -7,8 +12,13 @@ run: sass tmpl test: go test -v --tags=unit ./... +sass-slug: + mkdir -p static + sassc \ + -I scss scss/main.scss static/main.$(COMMIT).css + sass: - @mkdir -p static + mkdir -p static sassc \ -I scss scss/main.scss static/main.css |