1
0
mirror of https://github.com/danog/gojekyll.git synced 2024-11-27 11:34:46 +01:00
gojekyll/README.md

63 lines
2.5 KiB
Markdown
Raw Normal View History

# Go Jekyll
2017-06-12 00:59:02 +02:00
When I grow up, I want to be a [Go](https://golang.org) implementation of [Jekyll](https://jekyllrb.com).
## Status
2017-06-12 02:05:38 +02:00
[![Go Report Card](https://goreportcard.com/badge/github.com/osteele/gojekyll)](https://goreportcard.com/report/github.com/osteele/gojekyll)
2017-06-12 00:59:02 +02:00
This project is missing more functionality than it implements. It may accidentally work on tiny or simple sites, but I'd be surprised. Most egregious are an insufficiency of template variables, and limitations in the **liquid** library.
2017-06-12 01:39:39 +02:00
I'm writing this to learn my way around Go. It's not good for anything yet, and it may never come to anything.
## Install
```bash
2017-06-12 01:39:39 +02:00
go get -t
```
2017-06-12 01:39:39 +02:00
Sometimes this package benefits from my unmerged improvements to the **acstech/liquid** library. If you want to use [my fork](https://github.com/osteele/liquid) instead:
2017-06-12 00:59:02 +02:00
```bash
cd $(go env GOPATH)/src/github.com/acstech/liquid
2017-06-12 01:39:39 +02:00
git remote add osteele https://github.com/osteele/liquid.git
git pull -f osteele
2017-06-12 00:59:02 +02:00
```
2017-06-12 01:39:39 +02:00
(See articles by [Shlomi Noach](http://code.openark.org/blog/development/forking-golang-repositories-on-github-and-managing-the-import-path) and [Francesc Campoy](http://blog.campoy.cat/2014/03/github-and-go-forking-pull-requests-and.html) for how this works and why it is necessary.)
## Run
```bash
./scripts/gojekyll --source test build
./scripts/gojekyll --source test serve
2017-06-12 00:59:02 +02:00
./scripts/gojekyll --source test render index.md
./scripts/gojekyll --source test render /
```
2017-06-12 00:59:02 +02:00
`--source DIR` is optional.
2017-06-12 01:39:39 +02:00
`build` needn't be run before `server`. Tbe latter serves from memory.
`server` only rebuilds individual changed pages, doesn't rebuild collections, and doesn't detect new pages.
`render` renders a single file, identified by permalink if it starts with `/`, and by pathname (relative to the source directory) if it doesn't.
2017-06-12 00:59:02 +02:00
2017-06-12 01:39:39 +02:00
`./scripts/gojekyll` invokes `go run` each time. Alternatives to `./scripts/gojekyll` are: `go build && ./gojekyll ...`; or `go install && gojekyll ...` (if `$GOPATH/bin` is on your `$PATH`). These would be nicer for actual use (where the gojekyll sources don't change between invocations), but they aren't as handy during development.
2017-06-12 00:59:02 +02:00
## Credits
2017-06-12 01:39:39 +02:00
For rendering Liquid templates: the [acstech/liquid](https://github.com/acstech/liquid) fork of [karlseguin/liquid](https://github.com/karlseguin/liquid).
2017-06-12 00:59:02 +02:00
## Related
[Hugo](https://gohugo.io) isn't Jekyll-compatible (-), but actually works (+++).
## License
MIT
## Alternate Naming Possibilities
* "Gekyll". (Hard or soft "g"? See [gif](https://en.wikipedia.org/wiki/GIF#Pronunciation_of_GIF).)
* "Gekko"