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

120 lines
3.2 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-19 01:12:33 +02:00
This project is missing more functionality than it implements. It may accidentally work on tiny or simple sites.
- [ ] 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 04:59:53 +02:00
- [x] `link` tag
2017-06-19 04:24:10 +02:00
- [ ] Remaining Jekyll Liquid tags
- [ ] Jekyll Liquid filters
2017-06-19 01:12:33 +02:00
- [x] Includes
2017-06-28 04:59:53 +02:00
- [ ] parameters
- [ ] `include_relative`
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-20 15:00:04 +02:00
Jascha Ephraim's [jaschaephraim/lrserver](https://github.com/jaschaephraim/lrserver) Live Reload server.
2017-06-22 01:19:08 +02:00
<https://github.com/pkg/browser> to open the URL in a browser.
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-23 16:27:57 +02: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-19 04:49:23 +02:00
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"