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

123 lines
3.4 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-28 17:13:12 -04:00
See the significant missing functionality below. This tool currently works on some simple sites that don't use drafts, templates, future posts, or various other features listed below.
We are currently ~5x faster than Jekyll. Some obvious improvements would include caching SASS, caching templates, and using goroutines to render pages.
2017-06-18 19:12:33 -04:00
- [ ] Content
- [x] Front Matter
- [ ] Posts
- [ ] Categories
- [ ] Tags
- [ ] Drafts
- [ ] Future
- [ ] Related
- [x] Static Files
- [x] Variables
2017-06-22 08:34:37 -04:00
- [x] Collections
2017-06-18 19:12:33 -04:00
- [ ] Data Files
2017-06-19 14:44:34 -04:00
- [ ] CSV
- [ ] JSON
- [x] YAML
2017-06-18 19:12:33 -04:00
- [ ] Assets
- [ ] Coffeescript
2017-06-18 22:24:10 -04:00
- [x] Sass/SCSS
2017-06-19 09:15:52 -04:00
- [ ] Sass caching
2017-06-18 19:12:33 -04:00
- [ ] Customization
- [x] Templates
2017-06-28 16:55:15 -04:00
- [ ] Jekyll filters (partial)
- [ ] Jekyll tags (partial)
2017-06-28 14:42:04 -04:00
- [ ] `markdown=1`
2017-06-18 19:12:33 -04:00
- [x] Includes
2017-06-27 22:59:53 -04:00
- [ ] `include_relative`
2017-06-28 13:32:35 -04:00
- [x] parameters
- [ ] variables `{% include {{ expr }} %}`
2017-06-18 19:12:33 -04:00
- [x] Permalinks
- [ ] Pagination
- [ ] Themes
- [x] Layouts
- [x] Server
- [x] Directory watch
- [x] Live reload
2017-06-19 09:15:52 -04:00
- [ ] Windows -- not tested
2017-06-23 10:35:53 -04:00
Intentional differences from Jekyll:
- `serve` doesn't write to the file system
- No `.sass-cache`. (When caching is added, it will go to a temporary directory.)
- Server live reload is always on.
## Install
```bash
2017-06-22 08:34:37 -04:00
go get -u osteele/gojekyll/cmd/gojekyll
```
2017-06-19 10:27:57 -04:00
## Usage
```bash
2017-06-23 10:35:53 -04:00
gojekyll -s path/to/site build # builds into ./_site
gojekyll -s path/to/site serve # serves from memory, w/ live reload
2017-06-18 22:24:10 -04:00
gojekyll help
2017-06-23 10:35:53 -04:00
gojekyll help build
```
2017-06-11 18:59:02 -04:00
2017-06-23 10:27:57 -04:00
## Contributing
2017-06-20 09:00:04 -04:00
Install package dependencies and development tools:
```bash
make setup
```
2017-06-23 10:27:57 -04:00
### Testing
2017-06-19 09:15:52 -04:00
2017-06-19 14:03:51 -04:00
```bash
2017-06-20 09:00:04 -04:00
make test
make lint
2017-06-23 10:27:57 -04:00
gojekyll -s path/to/site render index.md # render a file to stdout
gojekyll -s path/to/site render / # render a URL to stdout
gojekyll -s path/to/site variables / # print a file or URL's variables
2017-06-22 17:53:46 -04:00
./scripts/coverage && go tool cover -html=coverage.out
2017-06-19 14:03:51 -04:00
```
2017-06-19 09:15:52 -04:00
`./scripts/gojekyll` is an alternative to the `gojekyll` executable, that uses `go run` each time it's invoked.
2017-06-23 10:27:57 -04:00
### Profiling
2017-06-19 09:15:52 -04:00
```bash
2017-06-23 10:27:57 -04:00
gojekyll -s path/to/site profile
2017-06-19 09:15:52 -04:00
go tool pprof gojekyll gojekyll.prof
```
2017-06-11 18:59:02 -04:00
## Credits
2017-06-20 09:00:04 -04:00
Jascha Ephraim's [jaschaephraim/lrserver](https://github.com/jaschaephraim/lrserver) Live Reload server.
2017-06-21 19:19:08 -04:00
<https://github.com/pkg/browser> to open the URL in a browser.
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-23 10:27:57 -04:00
This project is a clean-room implementation of Jekyll, based solely on Jekyll's documentation and testing it against a few sites. Hopefully this can pay off in contributing towards Jekyll's documentation.
2017-06-18 22:49:23 -04:00
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"