From 60e8e751c76d949a28eefe0c5462e0cf17337217 Mon Sep 17 00:00:00 2001 From: "Gabriel A. Giovanini" Date: Sun, 26 May 2024 23:07:42 +0200 Subject: feat: Add slug to build --- Makefile | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'Makefile') 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 -- cgit v1.2.3