aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
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