# HG changeset patch # User yakumo.izuru # Date 1712186236 0 # Node ID 897d57a7ec95bd3cd38f4a96712fa2ac08948764 # Parent 64cd79d367b57e331a0559aa2ca11d0cc8fc98cb Add support for disabling features at build time Signed-off-by: Izuru Yakumo diff -r 64cd79d367b5 -r 897d57a7ec95 Makefile --- a/Makefile Tue Mar 26 11:56:38 2024 +0000 +++ b/Makefile Wed Apr 03 23:17:16 2024 +0000 @@ -4,7 +4,6 @@ DATE ?= `date -u +%F` GOOS ?= `go env GOOS` VERSION ?= `git describe --tags` - build: go build ${GOFLAGS} ./cmd/aya clean: diff -r 64cd79d367b5 -r 897d57a7ec95 README.md --- a/README.md Tue Mar 26 11:56:38 2024 +0000 +++ b/README.md Wed Apr 03 23:17:16 2024 +0000 @@ -15,7 +15,7 @@ ## Installation -Build it manually assuming you have Go (>=1.17) installed: +Build it manually provided you have Go (>=1.17) installed: $ go install marisa.chaotic.ninja/aya/cmd/aya@latest (1) --- or --- @@ -27,6 +27,10 @@ (1) If you use this method, the `aya version` subcommand may print the wrong string, but it should not be a problem unless you use it on a page. +You can also disable certain features at build time, with the `-tags` switch. +Currently, these tags are available: `noamber`, `nogcss`. +See `go help buildconstraint` for more details. + ## Ideology Keep your texts in markdown, [amber](https://github.com/eknkc/amber), or html format right in the main directory @@ -35,7 +39,7 @@ Keep all service files (extensions, layout pages, deployment scripts etc) in the `.aya` subdirectory. -Define variables in the header of the content files using [YAML](https://www.yaml.io) : +Define variables in the header of the content files using [YAML](https://noyaml.com) : ```markdown title: My web site diff -r 64cd79d367b5 -r 897d57a7ec95 cmd/aya/amber.go --- a/cmd/aya/amber.go Tue Mar 26 11:56:38 2024 +0000 +++ b/cmd/aya/amber.go Wed Apr 03 23:17:16 2024 +0000 @@ -1,3 +1,4 @@ +//go:build !noamber // Render .amber files into .html package main diff -r 64cd79d367b5 -r 897d57a7ec95 cmd/aya/amber_stub.go --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmd/aya/amber_stub.go Wed Apr 03 23:17:16 2024 +0000 @@ -0,0 +1,11 @@ +//go:build noamber +package main + +import ( + "errors" + "io" +) + +func buildAmber(path string, w io.Writer, vars Vars) error { + return errors.New("Amber support was disabled on build-time") +} diff -r 64cd79d367b5 -r 897d57a7ec95 cmd/aya/gcss.go --- a/cmd/aya/gcss.go Tue Mar 26 11:56:38 2024 +0000 +++ b/cmd/aya/gcss.go Wed Apr 03 23:17:16 2024 +0000 @@ -1,3 +1,4 @@ +//go:build !nogcss // Render .gcss files into .css package main diff -r 64cd79d367b5 -r 897d57a7ec95 cmd/aya/gcss_stub.go --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmd/aya/gcss_stub.go Wed Apr 03 23:17:16 2024 +0000 @@ -0,0 +1,11 @@ +//go:build nogcss +package main + +import ( + "errors" + "io" +) + +func buildGCSS(path string, w io.Writer) error { + return errors.New("GCSS support was disabled at build time") +}