Description
When configuring syntax highlighting with a custom grammar, I accidentally used the incorrect field name extra_grammar (singular) instead of the correct extra_grammars (plural). Instead of getting an error about an unknown configuration field, Zola silently ignored the grammar and later reported that the language wasn't found, which was misleading and made debugging difficult.
Environment
· Zola version: 0.22.1
· OS: Arch Linux
Steps to reproduce
- Create a new Zola site:
zola init test-site
cd test-site
- Add a custom grammar file (e.g., pillar.json). For testing, you can use any valid syntax definition or even an empty file:
mkdir -p static/grammar
touch static/grammar/pillar.json
- Edit
zola.toml with incorrect field name:
[markdown.highlighting]
error_on_missing_language = true
style = "inline"
theme = "tokyo-night"
extra_grammar = [ "./static/grammar/pillar.json" ] # NOTE: Singular `extra_grammar`
- Create a content file with a code block using the custom language:
cat > content/test.md <<EOF
+++
title = "Test"
+++
\`\`\`pillar
some code
\`\`\`
EOF
- Run
zola build
Expected behaviour
Either:
- An error/warning about unknown configuration key
extra_grammar, OR
- An error that file coundn't be loaded due to invalid configuration
Actual Behavior
Building site...
ERROR Failed to build the site
ERROR Failed to render content of /workspace/test-site/content/test.md
ERROR Reason: Language `pillar` not found for syntax highlighting in "test.md".
Description
When configuring syntax highlighting with a custom grammar, I accidentally used the incorrect field name
extra_grammar(singular) instead of the correctextra_grammars(plural). Instead of getting an error about an unknown configuration field, Zola silently ignored the grammar and later reported that the language wasn't found, which was misleading and made debugging difficult.Environment
· Zola version: 0.22.1
· OS: Arch Linux
Steps to reproduce
zola init test-site cd test-sitezola.tomlwith incorrect field name:zola buildExpected behaviour
Either:
extra_grammar, ORActual Behavior