Go to file
Chris Morgan 1a9ab968fe Allow manual specification of header IDs (#685)
Justification for this feature is added in the docs.

Precedent for the precise syntax: Hugo.

Hugo puts this syntax behind a preference named headerIds, and automatic
header ID generation behind a preference named autoHeaderIds, with both
enabled by default. I have not implemented a switch to disable this.

My suggestion for a workaround for the improbable case of desiring a
literal “{#…}” at the end of a header is to replace `}` with `}`.

The algorithm I have used is not identical to [that
which Hugo uses][0], because Hugo’s looks to work at the source level,
whereas here we work at the pulldown-cmark event level, which is
generally more sane, but potentially limiting for extremely esoteric
IDs.

Practical differences in implementation from Hugo (based purely on
reading [blackfriday’s implementation][0], not actually trying it):

- I believe Hugo would treat `# Foo {#*bar*}` as a heading with text
  “Foo” and ID `*bar*`, since it is working at the source level; whereas
  this code turns it into a heading with HTML `Foo {#<em>bar</em>}`, as
  it works at the pulldown-cmark event level and doesn’t go out of its
  way to make that work (I’m not familiar with pulldown-cmark, but I get
  the impression that you could make it work Hugo’s way on this point).
  The difference should be negligible: only *very* esoteric hashes would
  include magic Markdown characters.

- Hugo will automatically generate an ID for `{#}`, whereas what I’ve
  coded here will yield a blank ID instead (which feels more correct to
  me—`None` versus `Some("")`, and all that).

In practice the results should be identical.

Fixes #433.

[0]: a477dd1646/block.go (L218-L234)
2019-05-20 13:08:49 -07:00
.github Update PULL_REQUEST_TEMPLATE.md 2019-05-07 07:18:26 -07:00
ci Rename all occurrences of gutenberg to zola in code 2018-10-18 22:50:06 +02:00
completions Rebuild completions 2018-11-12 21:37:26 +01:00
components Allow manual specification of header IDs (#685) 2019-05-20 13:08:49 -07:00
docs Allow manual specification of header IDs (#685) 2019-05-20 13:08:49 -07:00
src Process images at the end of the build process 2019-05-20 11:29:54 +02:00
sublime_syntaxes Build syntax dumps 2019-05-14 08:52:12 -07:00
sublime_themes One more time, Dracula theme, lol 2019-01-15 14:20:47 -08:00
test_site Ensure we don't delete root index without 2019-02-22 21:48:31 +01:00
test_site_i18n Add multilingual taxonomies 2019-01-07 21:03:34 +01:00
.editorconfig Create new project 2016-12-06 14:51:33 +09:00
.gitignore Merge pull request #567 from getzola/next 2019-03-25 20:26:07 +01:00
.gitmodules Point to https submodule instead of git 2018-11-15 17:12:36 +01:00
.travis.yml Pest now requires 1.31 2018-12-29 11:38:28 +01:00
appveyor.yml Pest now requires 1.31 2018-12-29 11:38:28 +01:00
build.rs rustfmt 2018-10-31 08:18:57 +01:00
Cargo.lock Start work on 0.7.1 2019-04-29 09:50:23 +02:00
Cargo.toml Start work on 0.7.1 2019-04-29 09:50:23 +02:00
CHANGELOG.md Start work on 0.7.1 2019-04-29 09:50:23 +02:00
CONTRIBUTING.md Adding GH specific issues/pr templates 2018-11-30 23:16:21 +01:00
EXAMPLES.md Update t-rex.tileserver.ch 2019-04-17 11:52:30 +02:00
is-ehh.svg improve README comparison svgs 2019-04-09 14:36:55 -04:00
is-no.svg improve README comparison svgs 2019-04-09 14:36:55 -04:00
is-yes.svg improve README comparison svgs 2019-04-09 14:36:55 -04:00
LICENSE USe date range for license 2018-01-16 13:39:56 +01:00
netlify.toml Is Netlify support working again? 2019-05-01 18:31:54 +02:00
README.md Merge branch 'master' into next 2019-05-15 21:42:51 -07:00
rustfmt.toml rustfmt 2018-10-31 08:18:57 +01:00
snapcraft.yaml Update snapcraft.yaml 2019-05-01 18:53:21 +02:00

zola (né Gutenberg)

Build Status Build status

A fast static site generator in a single binary with everything built-in.

Documentation is available on its site or in the docs/content folder of the repository and the community can use its forum.

Comparisons with other static site generators

Zola Cobalt Hugo Pelican
Single binary yes yes yes no
Language Rust Rust Go Python
Syntax highlighting yes yes yes yes
Sass compilation yes yes yes yes
Assets co-location yes yes yes yes
Multilingual site ehh no yes yes
Image processing yes no yes yes
Sane & powerful template engine yes yes ehh yes
Themes yes no yes yes
Shortcodes yes no yes yes
Internal links yes no yes yes
Link checker yes no no yes
Table of contents yes no yes yes
Automatic header anchors yes no yes yes
Aliases yes no yes yes
Pagination yes no yes yes
Custom taxonomies yes no yes no
Search yes no no yes
Data files yes yes yes no
LiveReload yes no yes yes
Netlify support yes no yes no
Breadcrumbs yes no no yes
Custom output formats no no yes no

Supported content formats

  • Zola: markdown
  • Cobalt: markdown
  • Hugo: markdown, asciidoc, org-mode
  • Pelican: reStructuredText, markdown, asciidoc, org-mode, whatever-you-want

ehh explanations

Hugo gets ehh for the template engine because while it is probably the most powerful template engine in the list, after Jinja2, it personally drives me insane, to the point of writing my own template engine and static site generator. Yes, this is a bit biased.

Zola gets ehh for the multi-language support as it only has a basic support and does not offer (yet) things like i18n in templates.

Pelican notes

Many features of Pelican are coming from plugins, which might be tricky to use because of version mismatch or lacking documentation. Netlify supports Python and Pipenv but you still need to install your dependencies manually.