aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorGabriel A. Giovanini <mail@gabrielgio.me>2024-05-26 23:07:42 +0200
committerGabriel A. Giovanini <mail@gabrielgio.me>2024-05-26 23:07:42 +0200
commit60e8e751c76d949a28eefe0c5462e0cf17337217 (patch)
tree59eaf44623710c7031dd3930b8d7bbdcde1b5d9d /Makefile
parente991b497e8433ee207e597b17f0b7daa3a0e0f26 (diff)
downloadcerrado-60e8e751c76d949a28eefe0c5462e0cf17337217.tar.gz
cerrado-60e8e751c76d949a28eefe0c5462e0cf17337217.tar.bz2
cerrado-60e8e751c76d949a28eefe0c5462e0cf17337217.zip
feat: Add slug to build
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 13 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 61df835..53b0767 100644
--- a/Makefile
+++ b/Makefile
@@ -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