Add support for disabling features at build time
Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja> git-svn-id: file:///srv/svn/repo/aya/trunk@87 cec141ff-132a-4243-88a5-ce187bd62f94
This commit is contained in:
1
Makefile
1
Makefile
@@ -4,7 +4,6 @@ PREFIX ?= /usr/local
|
|||||||
DATE ?= `date -u +%F`
|
DATE ?= `date -u +%F`
|
||||||
GOOS ?= `go env GOOS`
|
GOOS ?= `go env GOOS`
|
||||||
VERSION ?= `git describe --tags`
|
VERSION ?= `git describe --tags`
|
||||||
|
|
||||||
build:
|
build:
|
||||||
go build ${GOFLAGS} ./cmd/aya
|
go build ${GOFLAGS} ./cmd/aya
|
||||||
clean:
|
clean:
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ Named after [Aya Shameimaru](https://en.touhouwiki.net/wiki/Aya_Shameimaru) from
|
|||||||
|
|
||||||
## Installation
|
## 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)
|
$ go install marisa.chaotic.ninja/aya/cmd/aya@latest (1)
|
||||||
--- or ---
|
--- or ---
|
||||||
@@ -27,6 +27,10 @@ Build it manually assuming you have Go (>=1.17) installed:
|
|||||||
(1) If you use this method, the `aya version` subcommand may print the wrong string,
|
(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.
|
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
|
## Ideology
|
||||||
|
|
||||||
Keep your texts in markdown, [amber](https://github.com/eknkc/amber), or html format right in the main directory
|
Keep your texts in markdown, [amber](https://github.com/eknkc/amber), or html format right in the main directory
|
||||||
@@ -35,7 +39,7 @@ of your blog/site.
|
|||||||
Keep all service files (extensions, layout pages, deployment scripts etc)
|
Keep all service files (extensions, layout pages, deployment scripts etc)
|
||||||
in the `.aya` subdirectory.
|
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
|
```markdown
|
||||||
title: My web site
|
title: My web site
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
//go:build !noamber
|
||||||
// Render .amber files into .html
|
// Render .amber files into .html
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|||||||
11
cmd/aya/amber_stub.go
Normal file
11
cmd/aya/amber_stub.go
Normal file
@@ -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")
|
||||||
|
}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
//go:build !nogcss
|
||||||
// Render .gcss files into .css
|
// Render .gcss files into .css
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|||||||
11
cmd/aya/gcss_stub.go
Normal file
11
cmd/aya/gcss_stub.go
Normal file
@@ -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")
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user