1
0
mirror of https://github.com/danog/gojekyll.git synced 2025-01-23 00:21:15 +01:00
gojekyll/README.md

69 lines
2.8 KiB
Markdown
Raw Normal View History

# Go Jekyll
2017-06-11 18:59:02 -04:00
When I grow up, I want to be a [Go](https://golang.org) implementation of [Jekyll](https://jekyllrb.com).
## Status
2017-06-13 12:47:59 -04:00
[![Build Status](https://travis-ci.org/osteele/gojekyll.svg?branch=master)](https://travis-ci.org/osteele/gojekyll)
2017-06-11 20:05:38 -04:00
[![Go Report Card](https://goreportcard.com/badge/github.com/osteele/gojekyll)](https://goreportcard.com/report/github.com/osteele/gojekyll)
2017-06-11 18:59:02 -04: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-11 19:39:39 -04: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-15 09:34:16 -04:00
go install osteele/gojekyll
```
2017-06-11 19:39:39 -04: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-11 18:59:02 -04:00
```bash
cd $(go env GOPATH)/src/github.com/acstech/liquid
2017-06-11 19:39:39 -04:00
git remote add osteele https://github.com/osteele/liquid.git
git pull -f osteele
2017-06-11 18:59:02 -04:00
```
2017-06-11 19:39:39 -04: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
2017-06-15 09:39:06 -04:00
gojekyll --source test build
gojekyll --source test serve
gojekyll --source test render index.md # render a file to stdout
gojekyll --source test render / # render a URL to stdout
gojekyll --source test data / # print a path's template variables
```
2017-06-11 18:59:02 -04:00
`--source DIR` is optional.
2017-06-11 20:30:25 -04:00
`build` needn't be run before `server`. The latter serves from memory.
2017-06-11 19:39:39 -04:00
`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-11 18:59:02 -04:00
2017-06-15 09:39:06 -04:00
For develpment, `./scripts/gojekyll` uses `go run` each time it's invoked.
2017-06-11 18:59:02 -04:00
## Credits
2017-06-11 19:39:39 -04:00
For rendering Liquid templates: the [acstech/liquid](https://github.com/acstech/liquid) fork of [karlseguin/liquid](https://github.com/karlseguin/liquid).
2017-06-11 18:59:02 -04:00
2017-06-11 21:05:17 -04:00
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).
2017-06-11 18:59:02 -04:00
## Related
[Hugo](https://gohugo.io) isn't Jekyll-compatible (-), but actually works (+++).
2017-06-11 20:30:25 -04:00
[Jekyll](https://jekyllrb.com), of course.
2017-06-11 18:59:02 -04:00
## License
MIT
## Alternate Naming Possibilities
* "Gekyll". (Hard or soft "g"? See [gif](https://en.wikipedia.org/wiki/GIF#Pronunciation_of_GIF).)
* "Gekko"