Skip to content

Commit

Permalink
docs(troubleshooting): add examples of template render error
Browse files Browse the repository at this point in the history
- some errors do not show affected line
- related to hexojs/hexo#5031
  • Loading branch information
curbengh committed Aug 10, 2022
1 parent 98a7a6c commit ab3f316
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion source/docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,31 @@ FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/do
Template render error: (unknown path)
```

One possible reason is that there are some unrecognizable words in your file, e.g. invisible zero width characters.
Possible cause:
- There are some unrecognizable words in your file, e.g. invisible zero width characters.
- Incorrect use or limitation of [tag plugin](/docs/tag-plugins).
* Tag plugin is not enclosed with `{% endplugin_name %}`
```
# Incorrect
{% codeblock %}
fn()
{% codeblock %}
# Incorrect
{% codeblock %}
fn()
# Correct
{% codeblock %}
fn()
{% endcodeblock %}
```
* Having Nunjucks-like syntax in a tag plugin, e.g. [`{#`](https://mozilla.github.io/nunjucks/templating.html#comments). A workaround for this example is to use [triple backtick](/docs/tag-plugins#Backtick-Code-Block) instead. [Escape Contents](/docs/troubleshooting#Escape-Contents) section has more details.
```
{% codeblock lang:bash %}
Size of array is ${#ARRAY}
{% endcodeblock %}
```

[Warehouse]: https://github.com/hexojs/warehouse
[Swig]: http://paularmstrong.github.io/swig/
Expand Down

0 comments on commit ab3f316

Please sign in to comment.