2022-01-29 20:17:23 +01:00
# 30x faster fork of Gojekyll
2021-06-28 10:06:24 +02:00
<!-- ALL - CONTRIBUTORS - BADGE:START - Do not remove or modify this section -->
2022-02-06 11:18:56 +01:00
[![All Contributors ](https://img.shields.io/badge/all_contributors-5-orange.svg?style=flat-square )](#contributors-)
2021-06-28 10:06:24 +02:00
<!-- ALL - CONTRIBUTORS - BADGE:END -->
2017-07-02 05:54:12 +02:00
2021-06-19 05:36:03 +02:00
[![Golangci-lint badge][golangci-lint-svg]][golangci-lint-url]
[![Coveralls badge][coveralls-svg]][coveralls-url]
[![Go Report Card badge][go-report-card-svg]][go-report-card-url]
[![MIT License][license-svg]][license-url]
2017-06-10 21:38:09 +02:00
2021-06-19 06:05:10 +02:00
Gojekyll is a partially-compatible clone of the [Jekyll ](https://jekyllrb.com )
static site generator, written in the [Go ](https://golang.org ) programming
language. It provides `build` and `serve` commands, with directory watch and
2022-01-29 20:17:23 +01:00
live reload.
This fork also features native Chroma integration for a 30x performance improvement and support for additional Liquid tags.
2017-07-15 16:59:55 +02:00
2017-07-13 01:15:55 +02:00
| | Gojekyll | Jekyll | Hugo |
|-------------------------|-------------------------------------------|--------|--------------|
| Stable | | ✓ | ✓ |
2022-01-29 23:30:29 +01:00
| Fast | ✓< br > ([~30× Jekyll](./docs/benchmarks.md)) | | ✓ |
2019-02-05 23:36:47 +01:00
| Template language | Liquid | Liquid | Go, Ace and Amber templates |
| SASS | ✓ | ✓ | ✓ |
2017-07-13 01:15:55 +02:00
| Jekyll compatibility | [partial ](#current-limitations ) | ✓ | |
2019-02-05 23:36:47 +01:00
| Plugins | [some ](./docs/plugins.md ) | yes | shortcodes, theme components |
2022-02-06 10:59:44 +01:00
| Windows support | | ✓ | ✓ |
| Implementation language | Go | Ruby | Go |
2017-07-11 23:44:17 +02:00
2017-07-02 02:24:11 +02:00
<!-- TOC -->
2017-07-01 19:34:32 +02:00
2022-02-06 10:59:44 +01:00
- [Usage ](#usage )
- [Installation ](#installation )
- [Binary Downloads ](#binary-downloads )
- [From Source ](#from-source )
- [[Optional] Install command-line autocompletion](#optional-install-command-line-autocompletion)
- [Status ](#status )
- [Current Limitations ](#current-limitations )
- [Other Differences ](#other-differences )
- [Feature Checklist ](#feature-checklist )
- [Troubleshooting ](#troubleshooting )
- [Contributors ](#contributors )
- [Attribution ](#attribution )
- [Related ](#related )
- [License ](#license )
2017-07-02 02:24:11 +02:00
<!-- /TOC -->
2017-07-15 00:29:56 +02:00
## Usage
```bash
gojekyll build # builds the site in the current directory into _site
gojekyll serve # serve the app at http://localhost:4000; reload on changes
gojekyll help
gojekyll help build
```
2017-07-02 02:35:05 +02:00
## Installation
2017-07-20 18:30:55 +02:00
### Binary Downloads
2022-01-29 21:12:25 +01:00
1. Binaries are available from the [releases
2022-01-29 20:17:23 +01:00
page](https://github.com/danog/gojekyll/releases).
2. [Optional] **Themes** . To use a theme, you need to install Ruby and
2021-06-19 06:05:10 +02:00
[bundler ](http://bundler.io/ ). Create a `Gemfile` that lists the theme., and
run `bundle install` . The [Jekyll theme
instructions](https://jekyllrb.com/docs/themes/) provide more detail, and
should work for Gojekyll too.
2017-07-20 18:30:55 +02:00
### From Source
2017-07-15 00:29:56 +02:00
Pre-requisites:
2021-06-19 06:05:10 +02:00
1. **Install go** (1) via [Homebrew ](https://brew.sh ): `brew install go` ; or (2)
[download ](https://golang.org/doc/install#tarball ).
2017-07-25 18:00:41 +02:00
2. See items (2-3) under **Binary Downloads** , above, for optional installations.
2017-07-15 00:29:56 +02:00
2017-07-07 00:18:32 +02:00
First-time install:
2017-07-15 00:29:56 +02:00
```bash
2022-01-29 20:17:23 +01:00
go get github.com/danog/gojekyll
2017-07-15 00:29:56 +02:00
```
2017-07-07 00:18:32 +02:00
2017-08-18 20:35:16 +02:00
Update to the latest version:
2017-07-07 00:18:32 +02:00
2017-07-15 00:29:56 +02:00
```bash
2022-01-29 20:17:23 +01:00
go get -u github.com/danog/liquid github.com/danog/gojekyll
2017-07-15 00:29:56 +02:00
```
2017-07-02 02:35:05 +02:00
2017-08-18 20:35:16 +02:00
## [Optional] Install command-line autocompletion
Add this to your `.bashrc` or `.zshrc` :
2017-07-14 17:56:39 +02:00
```bash
# Bash:
eval "$(gojekyll --completion-script-bash)"
# Zsh:
eval "$(gojekyll --completion-script-zsh)"
```
2017-07-09 19:41:19 +02:00
## Status
2021-06-28 10:26:24 +02:00
This project works on the GitHub Pages sites that I and other contributors care
about. It looks credible on a spot-check of other Jekyll sites.
2017-07-09 19:41:19 +02:00
### Current Limitations
2017-07-02 02:24:11 +02:00
2017-07-07 21:48:31 +02:00
Missing features:
2017-07-09 20:05:46 +02:00
2017-08-16 22:11:03 +02:00
- Pagination
2017-08-14 20:50:35 +02:00
- Windows compatibility
2017-07-06 01:23:15 +02:00
- Math
2017-07-25 18:00:41 +02:00
- Plugin system. ([Some individual plugins](./docs/plugins.md) are emulated.)
2017-08-14 20:50:35 +02:00
- Liquid filter `sassify` is not implemented
2017-08-18 20:35:16 +02:00
- Liquid is run in strict mode: undefined filters and variables are errors.
- Missing markdown features:
2017-08-18 20:38:39 +02:00
- [attribute lists ](https://kramdown.gettalong.org/syntax.html#attribute-list-definitions )
2017-08-14 20:50:35 +02:00
- [`markdown="span"`, `markdown="block"` ](https://kramdown.gettalong.org/syntax.html#html-blocks )
2017-08-18 20:35:16 +02:00
- Markdown configuration options
2017-08-14 20:50:35 +02:00
2017-07-09 19:41:19 +02:00
Also see the [detailed status ](#feature-status ) below.
2017-07-06 01:23:15 +02:00
2017-07-09 19:41:19 +02:00
### Other Differences
2017-07-01 19:34:32 +02:00
2017-07-09 19:41:19 +02:00
These will probably not change:
2017-07-02 15:29:13 +02:00
2017-07-10 00:48:49 +02:00
By design:
2017-07-10 20:33:06 +02:00
- Plugins must be listed in the config file, not a Gemfile.
2021-06-19 06:05:10 +02:00
- The wrong type in a `_config.yml` file – for example, a list where a string is
expected, or vice versa – is generally an error.
2017-07-15 00:29:56 +02:00
- Server live reload is always on.
- `serve --watch` (the default) reloads the `_config.yml` and data files too.
2017-07-16 17:31:36 +02:00
- `serve` generates pages on the fly; it doesn't write to the file system.
2017-07-17 17:48:30 +02:00
- Files are cached in `/tmp/gojekyll-${USER}` , not `./.sass-cache`
2017-08-27 20:33:58 +02:00
Upstream:
2017-08-18 16:49:20 +02:00
- Markdown:
2021-06-19 06:05:10 +02:00
- `<` and `>` inside markdown is interpreted as HTML. For example, `This is
< b > bold< / b > ` renders as < b > bold< / b > . This behavior matches the [Markdown
spec](https://daringfireball.net/projects/markdown/syntax#html), but differs
from Jekyll's default Kramdown processor.
- The autogenerated id of a header that includes HTML is computed from the
text of the title, ignoring its attributes. For example, the id of `## Title
(< a href = "https://example.com/path/to/details" > ref</ a > ))` is `#title-ref` ,
not `#title-https-example-path-to-details-ref` .
- Autogenerated header ids replace punctuation by the hyphens, rather than the
empty string. For example, the id of `## Either/or` is `#either-or` not
`#eitheror` ; the id of `## I'm Lucky` is `#i-m-lucky` not `#im-lucky` .
2017-07-05 23:02:58 +02:00
2017-07-10 00:48:49 +02:00
Muzukashii:
2017-07-02 02:24:11 +02:00
2021-06-19 06:05:10 +02:00
- An extensible plugin mechanism – support for plugins that aren't compiled into
the executable.
2017-07-02 02:24:11 +02:00
2017-07-10 00:48:49 +02:00
### Feature Checklist
2017-06-19 01:12:33 +02:00
- [ ] Content
- [x] Front Matter
2017-07-10 00:48:49 +02:00
- [x] Posts
2017-06-19 01:12:33 +02:00
- [x] Static Files
- [x] Variables
2017-06-22 14:34:37 +02:00
- [x] Collections
2017-07-15 00:29:56 +02:00
- [x] Data Files
2017-06-19 01:12:33 +02:00
- [ ] Assets
- [ ] Coffeescript
2017-06-19 04:24:10 +02:00
- [x] Sass/SCSS
2017-06-19 01:12:33 +02:00
- [ ] Customization
- [x] Templates
2017-06-29 15:41:33 +02:00
- [ ] Jekyll filters
2017-08-18 20:38:39 +02:00
- [ ] `scssify`
2017-06-29 15:41:33 +02:00
- [x] everything else
2017-07-04 23:13:47 +02:00
- [x] Jekyll tags
2017-06-19 01:12:33 +02:00
- [x] Includes
- [x] Permalinks
- [ ] Pagination
2017-07-15 00:29:56 +02:00
- [ ] Plugins – partial; see [here ](./docs/plugins.md )
2017-07-24 15:32:57 +02:00
- [x] Themes
2017-06-19 01:12:33 +02:00
- [x] Layouts
- [x] Server
- [x] Directory watch
2017-07-01 19:34:32 +02:00
- [ ] Commands
- [x] `build`
2017-07-25 15:29:38 +02:00
- [x] `--source` , `--destination` , `--drafts` , `--future` , `--unpublished`
2017-08-18 20:38:39 +02:00
- [x] `--incremental` , `--watch` , `--force_polling` , `JEKYLL_ENV=production`
- [ ] `--baseurl` , `--config` , `--lsi`
2017-07-25 18:00:41 +02:00
- [ ] `--limit-posts`
2017-07-01 19:34:32 +02:00
- [x] `clean`
- [x] `help`
- [x] `serve`
2017-07-25 15:29:38 +02:00
- [x] `--open-uri` , `--host` , `--port`
- [x] `--incremental` , `– watch` , `--force_polling`
- [ ] `--baseurl` , `--config`
2017-07-15 00:29:56 +02:00
- [ ] `--detach` , `--ssl` -* – not planned
- [ ] `doctor` , `import` , `new` , `new-theme` – not planned
2017-07-10 00:48:49 +02:00
- [ ] Windows
2017-06-10 21:38:09 +02:00
2022-02-06 10:59:44 +01:00
## Troubleshooting
If the error is "403 API rate limit exceeded", you are probably building a
repository that uses the `jekyll-github-metadata` gem. Try setting the
`JEKYLL_GITHUB_TOKEN` , `JEKYLL_GITHUB_TOKEN` , or `OCTOKIT_ACCESS_TOKEN`
environment variable to the value of a [GitHub personal access
token][personal-access-token] and trying again.
[personal-access-token]: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token
2021-06-28 10:26:24 +02:00
## Contributors
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
<!-- ALL - CONTRIBUTORS - LIST:START - Do not remove or modify this section -->
<!-- prettier - ignore - start -->
<!-- markdownlint - disable -->
< table >
< tr >
2022-01-29 20:17:23 +01:00
< td align = "center" > < a href = "https://code.danog.com/" > < img src = "https://avatars.githubusercontent.com/u/674?v=4?s=100" width = "100px;" alt = "" / > < br / > < sub > < b > Oliver Steele< / b > < / sub > < / a > < br / > < a href = "https://github.com/danog/gojekyll/commits?author=danog" title = "Code" > 💻< / a > < a href = "#design-danog" title = "Design" > 🎨< / a > < a href = "https://github.com/danog/gojekyll/commits?author=danog" title = "Documentation" > 📖< / a > < a href = "#ideas-danog" title = "Ideas, Planning, & Feedback" > 🤔< / a > < a href = "#infra-danog" title = "Infrastructure (Hosting, Build-Tools, etc)" > 🚇< / a > < a href = "#maintenance-danog" title = "Maintenance" > 🚧< / a > < a href = "#projectManagement-danog" title = "Project Management" > 📆< / a > < a href = "https://github.com/danog/gojekyll/pulls?q=is%3Apr+reviewed-by%3Adanog" title = "Reviewed Pull Requests" > 👀< / a > < a href = "https://github.com/danog/gojekyll/commits?author=danog" title = "Tests" > ⚠️< / a > < / td >
< td align = "center" > < a href = "https://bep.is/" > < img src = "https://avatars.githubusercontent.com/u/394382?v=4?s=100" width = "100px;" alt = "" / > < br / > < sub > < b > Bjørn Erik Pedersen< / b > < / sub > < / a > < br / > < a href = "https://github.com/danog/gojekyll/commits?author=bep" title = "Documentation" > 📖< / a > < / td >
< td align = "center" > < a href = "https://tqdev.com/" > < img src = "https://avatars.githubusercontent.com/u/1288217?v=4?s=100" width = "100px;" alt = "" / > < br / > < sub > < b > Maurits van der Schee< / b > < / sub > < / a > < br / > < a href = "https://github.com/danog/gojekyll/commits?author=mevdschee" title = "Code" > 💻< / a > < / td >
2021-06-28 10:26:24 +02:00
< / tr >
< / table >
<!-- markdownlint - restore -->
<!-- prettier - ignore - end -->
2017-06-20 15:00:04 +02:00
2021-06-28 10:26:24 +02:00
<!-- ALL - CONTRIBUTORS - LIST:END -->
This project follows the
[all-contributors ](https://github.com/all-contributors/all-contributors )
specification. [Contributions of any kind welcome ](./CONTRIBUTING.md )!
2017-06-12 00:59:02 +02:00
2017-07-09 21:21:11 +02:00
## Attribution
2017-06-12 00:59:02 +02:00
2017-06-29 13:08:37 +02:00
Gojekyll uses these libraries:
2017-06-20 15:00:04 +02:00
2017-07-25 18:00:41 +02:00
| Package | Author(s) | Usage | License |
2022-02-06 10:59:44 +01:00
| ------------------------------------------------------------------------------ | ------------------------------------------------------ | -------------------------------------- | --------------------------------------- |
2017-07-25 18:00:41 +02:00
| [github.com/jaschaephraim/lrserver ](https://github.com/jaschaephraim/lrserver ) | Jascha Ephraim | Live Reload | MIT License |
| [github.com/kyokomi/emoji ](https://github.com/kyokomi/emoji ) | kyokomi | `jemoji` plugin emulation | MIT License |
2022-01-29 20:17:23 +01:00
| [github.com/danog/liquid ](https://github.com/danog/liquid ) | yours truly | Liquid processor | MIT License |
2017-07-25 18:00:41 +02:00
| [github.com/pkg/browser ](https://github.com/pkg/browser ) | [pkg ](https://github.com/pkg ) | `serve --open-url` option | BSD 2-clause "Simplified" License |
2017-07-26 17:34:42 +02:00
| [github.com/radovskyb/watcher ](https://github.com/radovskyb/watcher ) | Benjamin Radovsky | Polling file watch (`--force_polling`) | BSD 3-clause "New" or "Revised" License |
2017-07-25 18:00:41 +02:00
| [github.com/russross/blackfriday ](https://github.com/russross/blackfriday ) | Russ Ross | Markdown processing | Simplified BSD License |
| [github.com/sass/libsass ](https://github.com/sass/libsass ) | Listed [here ](https://https://github.com/sass/libsass ) | C port of the Ruby SASS compiler | MIT License |
2017-07-26 17:34:42 +02:00
| [github.com/tdewolff/minify ](https://github.com/tdewolff/minify ) | Taco de Wolff | CSS minimization | MIT License |
2017-07-25 18:00:41 +02:00
| [github.com/wellington/go-libsass ](https://github.com/wellington/go-libsass ) | Drew Wells | Go bindings for **libsass** | ??? |
| [gopkg.in/alecthomas/kingpin.v2 ](https://github.com/alecthomas/kingpin ) | Alec Thomas | command-line arguments | MIT License |
2022-02-06 11:31:40 +01:00
| [github.com/alecthomas/chroma ](https://github.com/alecthomas/chroma ) | Alec Thomas | Syntax highlighter | MIT License |
2017-07-25 18:00:41 +02:00
| [gopkg.in/yaml.v2 ](https://github.com/go-yaml/yaml ) | Canonical | YAML support | Apache License 2.0 |
2017-06-29 13:08:37 +02:00
2017-07-09 19:41:19 +02:00
In addition, the following pieces of text were taken from Jekyll and its plugins.
They are used under the terms of the MIT License.
2017-07-09 07:22:32 +02:00
2017-07-09 21:07:14 +02:00
| Source | Use | Description |
2022-02-06 10:59:44 +01:00
| ------------------------------------------------------------------------------- | -------------------- | ---------------------- |
2017-07-09 19:41:19 +02:00
| [Jekyll template documentation ](https://jekyllrb.com/docs/templates/ ) | test cases | filter examples |
2017-07-25 18:00:41 +02:00
| `jekyll help` command | `gojekyll help` text | help text |
2017-07-09 19:41:19 +02:00
| [`jekyll-feed` plugin ](https://github.com/jekyll/jekyll-feed ) | plugin emulation | `feed.xml` template |
| [`jekyll-redirect-from` plugin ](https://github.com/jekyll/jekyll-redirect-from ) | plugin emulation | redirect page template |
2017-07-13 01:15:55 +02:00
| [`jekyll-sitemap` plugin ](https://github.com/jekyll/jekyll-redirect-from ) | plugin emulation | sitemap template |
| [`jekyll-seo-tag` plugin ](https://github.com/jekyll/jekyll-redirect-from ) | plugin emulation | feed template |
2017-07-09 01:57:41 +02:00
2017-07-17 17:48:30 +02:00
The theme for in-browser error reporting was adapted from facebookincubator/create-react-app.
2021-06-19 06:05:10 +02:00
The gopher image in the `testdata` 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 03:05:17 +02:00
2021-06-19 06:05:10 +02:00
In addition to being totally and obviously inspired by Jekyll and its plugins,
Jekyll's solid *documentation* was indispensible --- especially since I wanted
to implement Jekyll as documented, not port its source code. The [Jekyll
docs](https://jekyllrb.com/docs/home/) were always open in at least one tab
during development.
2017-07-09 03:41:35 +02:00
2017-06-12 00:59:02 +02:00
## Related
2021-06-19 06:05:10 +02:00
[Hugo ](https://gohugo.io ) is the pre-eminent Go static site generator. It isn't
Jekyll-compatible (-), but it's highly polished, performant, and productized
(+++).
2017-07-09 19:41:19 +02:00
2021-06-19 06:05:10 +02:00
[jkl ](https://github.com/drone/jkl ) is another Go clone of Jekyll. If I'd found
it sooner I might have started this project by forking that one. It's got a
better name.
2017-06-12 00:59:02 +02:00
2022-01-29 20:17:23 +01:00
[Liquid ](https://github.com/danog/liquid ) is a pure Go implementation of
2021-06-19 06:05:10 +02:00
Liquid templates, that I finally caved and wrote in order to use in this
project.
2017-07-02 02:24:11 +02:00
2017-06-12 02:30:25 +02:00
[Jekyll ](https://jekyllrb.com ), of course.
2017-06-12 00:59:02 +02:00
## License
MIT
2017-07-07 00:18:32 +02:00
2022-01-29 20:17:23 +01:00
[coveralls-url]: https://coveralls.io/r/danog/gojekyll
[coveralls-svg]: https://img.shields.io/coveralls/danog/gojekyll.svg?branch=master
2017-07-07 00:18:32 +02:00
2022-01-29 20:17:23 +01:00
[license-url]: https://github.com/danog/gojekyll/blob/master/LICENSE
2017-07-07 00:18:32 +02:00
[license-svg]: https://img.shields.io/badge/license-MIT-blue.svg
2022-01-29 20:17:23 +01:00
[golangci-lint-url]: https://github.com/danog/gojekyll/actions?query=workflow%3Agolangci-lint
[golangci-lint-svg]: https://github.com/danog/gojekyll/actions/workflows/golangci-lint.yml/badge.svg
2021-06-19 05:36:03 +02:00
2022-01-29 20:17:23 +01:00
[go-report-card-url]: https://goreportcard.com/report/github.com/danog/gojekyll
[go-report-card-svg]: https://goreportcard.com/badge/github.com/danog/gojekyll