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

132 lines
4.3 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-13 18:47:59 +02:00
[![Build Status](https://travis-ci.org/osteele/gojekyll.svg?branch=master)](https://travis-ci.org/osteele/gojekyll)
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-28 23:13:12 +02: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-19 01:12:33 +02:00
- [ ] Content
- [x] Front Matter
- [ ] Posts
- [ ] Categories
- [ ] Tags
- [ ] Drafts
- [ ] Future
- [ ] Related
- [x] Static Files
- [x] Variables
2017-06-22 14:34:37 +02:00
- [x] Collections
2017-06-19 01:12:33 +02:00
- [ ] Data Files
2017-06-19 20:44:34 +02:00
- [ ] CSV
- [ ] JSON
- [x] YAML
2017-06-19 01:12:33 +02:00
- [ ] Assets
- [ ] Coffeescript
2017-06-19 04:24:10 +02:00
- [x] Sass/SCSS
2017-06-19 15:15:52 +02:00
- [ ] Sass caching
2017-06-19 01:12:33 +02:00
- [ ] Customization
- [x] Templates
2017-06-28 22:55:15 +02:00
- [ ] Jekyll filters (partial)
- [ ] Jekyll tags (partial)
2017-06-28 20:42:04 +02:00
- [ ] `markdown=1`
2017-06-19 01:12:33 +02:00
- [x] Includes
2017-06-28 04:59:53 +02:00
- [ ] `include_relative`
2017-06-28 19:32:35 +02:00
- [x] parameters
- [ ] variables `{% include {{ expr }} %}`
2017-06-19 01:12:33 +02:00
- [x] Permalinks
- [ ] Pagination
- [ ] Themes
- [x] Layouts
- [x] Server
- [x] Directory watch
- [x] Live reload
2017-06-19 15:15:52 +02:00
- [ ] Windows -- not tested
2017-06-23 16:35:53 +02: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 14:34:37 +02:00
go get -u osteele/gojekyll/cmd/gojekyll
```
2017-06-19 16:27:57 +02:00
## Usage
```bash
2017-06-23 16:35:53 +02:00
gojekyll -s path/to/site build # builds into ./_site
gojekyll -s path/to/site serve # serves from memory, w/ live reload
2017-06-19 04:24:10 +02:00
gojekyll help
2017-06-23 16:35:53 +02:00
gojekyll help build
```
2017-06-12 00:59:02 +02:00
2017-06-23 16:27:57 +02:00
## Contributing
2017-06-20 15:00:04 +02:00
Install package dependencies and development tools:
```bash
make setup
```
2017-06-23 16:27:57 +02:00
### Testing
2017-06-19 15:15:52 +02:00
2017-06-19 20:03:51 +02:00
```bash
2017-06-20 15:00:04 +02:00
make test
make lint
2017-06-23 16:27:57 +02: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 23:53:46 +02:00
./scripts/coverage && go tool cover -html=coverage.out
2017-06-19 20:03:51 +02:00
```
2017-06-19 15:15:52 +02:00
`./scripts/gojekyll` is an alternative to the `gojekyll` executable, that uses `go run` each time it's invoked.
2017-06-23 16:27:57 +02:00
### Profiling
2017-06-19 15:15:52 +02:00
```bash
2017-06-23 16:27:57 +02:00
gojekyll -s path/to/site profile
2017-06-19 15:15:52 +02:00
go tool pprof gojekyll gojekyll.prof
```
2017-06-12 00:59:02 +02:00
## Credits
2017-06-29 13:08:37 +02:00
Gojekyll uses these libraries:
2017-06-20 15:00:04 +02:00
2017-06-29 13:08:37 +02:00
| Package | Author | Description |
| --- | --- | --- |
| [github.com/jaschaephraim/lrserver](https://github.com/jaschaephraim/lrserver) | Jascha Ephraim | Live Reload server |
| [github.com/osteele/liquid](https://github.com/osteele/liquid) | Oliver Steele | Liquid processor |
| [github.com/pkg/browser](https://github.com/pkg/browser) | [pkg](https://github.com/pkg) | The `serve -o` option to open the site in the browser |
| [github.com/russross/blackfriday](https://github.com/russross/blackfriday) | Russ Ross | Markdown processor |
| [github.com/sass/libsass](https://github.com/sass/libsass) | Listed [here](https://https://github.com/sass/libsass) | C port of the Ruby SASS compiler |
| [github.com/wellington/go-libsass](https://github.com/wellington/go-libsass) | Drew Wells | Go bindings to libsass |
| [gopkg.in/alecthomas/kingpin.v2](https://github.com/alecthomas/kingpin) | Alec Thomas | command line and flag parser |
| [gopkg.in/yaml.v2](https://github.com/go-yaml) | Canonical | YAML support |
In addition to being totally and obviously inspired by the Jekyll Ruby implementation, Jekyll's solid documentation was indispensible. The [Jekyll docs](https://jekyllrb.com/docs/home/) were always open in at least one tab.
2017-06-22 01:19:08 +02:00
2017-06-12 03:05:17 +02: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-12 00:59:02 +02:00
## Related
[Hugo](https://gohugo.io) isn't Jekyll-compatible (-), but actually works (+++).
2017-06-12 02:30:25 +02:00
[Jekyll](https://jekyllrb.com), of course.
2017-06-12 00:59:02 +02:00
## License
MIT
## Alternate Naming Possibilities
* "Gekyll". (Hard or soft "g"? See [gif](https://en.wikipedia.org/wiki/GIF#Pronunciation_of_GIF).)
* "Gekko"