mirror of
https://github.com/danog/gojekyll.git
synced 2024-11-27 03:24:40 +01:00
Add a Makefile
This commit is contained in:
parent
67ebfd87a9
commit
6938f80fea
45
Makefile
Normal file
45
Makefile
Normal file
@ -0,0 +1,45 @@
|
||||
SOURCEDIR=.
|
||||
SOURCES := $(shell find $(SOURCEDIR) -name '*.go')
|
||||
|
||||
BINARY = gojekyll
|
||||
PACKAGE = github.com/osteele/gojekyll
|
||||
COMMIT_HASH = `git rev-parse --short HEAD 2>/dev/null`
|
||||
BUILD_TIME = `date +%FT%T%z`
|
||||
|
||||
VERSION=0.0.0
|
||||
|
||||
LDFLAGS=-ldflags "-X ${PACKAGE}.Version=${VERSION} -X ${PACKAGE}.BuildTime=${BUILD_TIME}"
|
||||
|
||||
.DEFAULT_GOAL: $(BINARY)
|
||||
.PHONY: build clean dependencies setup install lint test help
|
||||
|
||||
$(BINARY): $(SOURCES)
|
||||
go build ${LDFLAGS} -o ${BINARY} ${PACKAGE}/cmd/gojekyll
|
||||
|
||||
build: $(BINARY) ## compile the package
|
||||
|
||||
clean: ## remove binary files
|
||||
rm -fI ${BINARY}
|
||||
|
||||
dependencies: ## list dependencies
|
||||
go list -f '{{ join .Imports "\n" }}' \
|
||||
| grep -v ${PACKAGE} \
|
||||
| grep '\.'
|
||||
|
||||
setup: ## install dependencies and development tools
|
||||
go get ./...
|
||||
go get -u github.com/alecthomas/gometalinter
|
||||
gometalinter --install
|
||||
|
||||
install: ## compile and install the executable
|
||||
go install ${LDFLAGS} ${PACKAGE}/cmd/gojekyll
|
||||
|
||||
lint: ## lint the package
|
||||
gometalinter ./...
|
||||
|
||||
test: ## test the package
|
||||
go test ${LDFLAGS} ./...
|
||||
|
||||
# Source: https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
|
||||
help:
|
||||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|
14
README.md
14
README.md
@ -87,9 +87,19 @@ This is currently about 10x slower than using the embedded engine, but still 5x
|
||||
|
||||
Neither the embedded Liquid server nor the Liquid Template Server implements very many Jekyll Liquid filters or tags. I'm adding to these as necessary to support my own sites.
|
||||
|
||||
## Development
|
||||
## Develop
|
||||
|
||||
Install package dependencies and development tools:
|
||||
|
||||
```bash
|
||||
make setup
|
||||
```
|
||||
|
||||
Test:
|
||||
|
||||
```bash
|
||||
make test
|
||||
make lint
|
||||
gojekyll render index.md # render a file to stdout
|
||||
gojekyll render / # render a URL to stdout
|
||||
gojekyll variables / # print a file or URL's variables
|
||||
@ -108,6 +118,8 @@ go tool pprof gojekyll gojekyll.prof
|
||||
|
||||
For rendering Liquid templates: ACS Technologies's fork [acstech/liquid](https://github.com/acstech/liquid) of Karl Seguin's [karlseguin/liquid](https://github.com/karlseguin/liquid) Go implementation; or, Jun Yang's JavaScript implementation [harttle/shopify-liquid](https://github.com/harttle/shopify-liquid/) via JSON-RPC.
|
||||
|
||||
Jascha Ephraim's [jaschaephraim/lrserver](https://github.com/jaschaephraim/lrserver) Live Reload server.
|
||||
|
||||
The gopher image in the test directory is from [Wikimedia Commons](https://commons.wikimedia.org/wiki/File:Gophercolor.jpg). It is used under the [Creative Commons Attribution-Share Alike 3.0 Unported license](https://creativecommons.org/licenses/by-sa/3.0/deed.en).
|
||||
|
||||
## Related
|
||||
|
Loading…
Reference in New Issue
Block a user