Skip to content

Commit

Permalink
docs(troubleshooting): wrap nunjucks tag with backtick
Browse files Browse the repository at this point in the history
  • Loading branch information
curbengh committed Aug 24, 2020
1 parent 88ba22b commit 8832c75
Show file tree
Hide file tree
Showing 7 changed files with 107 additions and 18 deletions.
10 changes: 8 additions & 2 deletions source/docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,20 @@ When you can't get any command except `help`, `init` and `version` to work and y

## Escape Contents

Hexo uses [Nunjucks] to render posts ([Swig] was used in older version, which share a similar syntax). Content wrapped with `{% raw %}{{ }}{% endraw %}` or `{% raw %}{% %}{% endraw %}` will get parsed and may cause problems. You can wrap sensitive content with the `raw` tag plugin.
Hexo uses [Nunjucks] to render posts ([Swig] was used in older version, which share a similar syntax). Content wrapped with `{{ }}` or `{% %}` will get parsed and may cause problems. You can skip the parsing by wrapping it with the [`raw`](/docs/tag-plugins#Raw) tag plugin, single backtick ```` `{{ }}` ```` or triple backtick.

```
{% raw %}
Hello {{ sensitive }}
Hello {{ world }}
{% endraw %}
```

````
```
Hello {{ world }}
```
````

## ENOSPC Error (Linux)

Sometimes when running the command `$ hexo server` it returns an error:
Expand Down
11 changes: 9 additions & 2 deletions source/ko/docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,20 @@ $ hexo clean

## Escape Contents

Hexo는 포스트를 렌더링하는데 [Nunjucks]를 사용합니다([Swig]은 이전 버전에서 사용했었습니다. 문법은 비슷합니다.). `{% raw %}{{ }}{% endraw %}` 또는 `{% raw %}{% %}{% endraw %}`로 감싼 컨텐츠는 파싱된 후에 문제를 발생시킵니다. 민감한 컨텐츠는 `raw` 태그 플러그인으로 감싸는 것이 좋습니다.
Hexo는 포스트를 렌더링하는데 [Nunjucks]를 사용합니다([Swig]은 이전 버전에서 사용했었습니다. 문법은 비슷합니다.). `{{ }}` 또는 `{% %}`로 감싼 컨텐츠는 파싱된 후에 문제를 발생시킵니다. You can skip the parsing by wrapping it with the [`raw`](/docs/tag-plugins#Raw) tag plugin, single backtick ```` `{{ }}` ```` or triple backtick.

```
{% raw %}
Hello {{ sensitive }}
Hello {{ world }}
{% endraw %}
```

````
```
Hello {{ world }}
```
````

## ENOSPC Error (Linux)
`$ hexo server`명령어가 가끔 error를 반환할 때가 있습니다.
```
Expand Down
10 changes: 8 additions & 2 deletions source/pt-br/docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,20 @@ Quando você não consegue executar nenhum comando do Hexo, com exceção de `he

## Conteúdo Escapando

O Hexo usa [Nunjucks] para renderizar posts ([Swig] foi usado na versão mais antiga, que compartilha uma sintaxe semelhante). O conteúdo delimitado com `{% raw %}{{ }}{% endraw %}` ou `{% raw %}{% %}{% endraw %}` será "parseado" e pode causar problemas. Você pode empacotar um conteúdo sensível com a [tag plugin `raw`](tag-plugins.html#Raw).
O Hexo usa [Nunjucks] para renderizar posts ([Swig] foi usado na versão mais antiga, que compartilha uma sintaxe semelhante). O conteúdo delimitado com `{{ }}` ou `{% %}` será "parseado" e pode causar problemas. Você pode empacotar um conteúdo sensível com a tag plugin [`raw`](/docs/tag-plugins#Raw), single backtick ```` `{{ }}` ```` or triple backtick.

```
{% raw %}
Hello {{ sensitive }}
Hello {{ world }}
{% endraw %}
```

````
```
Hello {{ world }}
```
````

## ENOSPC Error (Linux)

Às vezes, ao executar o comando `$ hexo server` é retornado o seguinte erro:
Expand Down
12 changes: 9 additions & 3 deletions source/ru/docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,20 @@ $ hexo clean

## Содержимое не найдено

Hexo использует [Nunjucks] для отображения сообщения ([Swig] использовался в предыдущей версии, он использует похожий синтаксис). Содержимое, обёрнутое, в `{% raw %}{{ }}{% endraw %}` или `{% raw %}{% %}{% endraw %}`, поможет вам разобраться, какая часть вызвала проблемы. Можно переносить конфиденциальные данные с `raw` плагином.
Hexo использует [Nunjucks] для отображения сообщения ([Swig] использовался в предыдущей версии, он использует похожий синтаксис). Содержимое, обёрнутое, в `{{ }}` или `{% %}`, поможет вам разобраться, какая часть вызвала проблемы. You can skip the parsing by wrapping it with the [`raw`](/docs/tag-plugins#Raw) tag plugin, single backtick ```` `{{ }}` ```` or triple backtick.

``` plain
```
{% raw %}
Hello {{ sensitive }}
Hello {{ world }}
{% endraw %}
```

````
```
Hello {{ world }}
```
````

## ENOSPC Error (Linux)

Иногда команда `$ hexo server` возвращает ошибку:
Expand Down
15 changes: 10 additions & 5 deletions source/th/docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,17 +155,22 @@ $ hexo clean
## Escape Contents

hexo ใช้ [Nunjucks] เพื่อ render โพสต์ (ในเวอร์ชั่นเก่าใช้ [Swig] ซึ่งมี
syntax เหมือนกัน) เนื้อหาที่ห่อด้วย `{% raw %}{{ }}{% endraw %}` หรือ `{% raw
%}{% %}{% endraw %}` อาจจะถูก parse ไม่ถูกต้องและเกิดปัญหาบ้าง
เพื่อป้องกันเรื่องนี้เกิดขึ้น คุณสามารถติดตั้งปลั๊กอินแท็ก `raw`
และห่อเนื้อหาท่ีอาจจะถูก parse ไม่ถูกต้องนั้นด้วยแท็กนี้
syntax เหมือนกัน) เนื้อหาที่ห่อด้วย `{{ }}` หรือ `{% %}` อาจจะถูก parse ไม่ถูกต้องและเกิดปัญหาบ้าง
เพื่อป้องกันเรื่องนี้เกิดขึ้น คุณสามารถติดตั้งปลั๊กอินแท็ก
You can skip the parsing by wrapping it with the [`raw`](/docs/tag-plugins#Raw) tag plugin, single backtick ```` `{{ }}` ```` or triple backtick.

```
{% raw %}
Hello {{ sensitive }}
Hello {{ world }}
{% endraw %}
```

````
```
Hello {{ world }}
```
````

## ENOSPC Error (Linux)

บางทีเมื่อรันคำสั่ง `$ hexo server` ผลท่ีส่งกลับมาเป็นข้อผิดพลาด:
Expand Down
10 changes: 8 additions & 2 deletions source/zh-cn/docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,20 @@ $ hexo clean

## 泄露(Escape)内容

Hexo 使用 [Nunjucks] 来解析文章(旧版本使用 [Swig],两者语法类似),内容若包含 `{% raw %}{{ }}{% endraw %}``{% raw %}{% %}{% endraw %}` 可能导致解析错误,您可以用 `raw` 标签包裹来避免潜在问题发生
Hexo 使用 [Nunjucks] 来解析文章(旧版本使用 [Swig],两者语法类似),内容若包含 `{{ }}``{% %}` 可能导致解析错误,您可以用 [`raw`](/docs/tag-plugins#Raw) 标签包裹,single backtick ```` `{{ }}` ```` 或 triple backtick 来避免潜在问题发生

```
{% raw %}
Hello {{ sensitive }}
Hello {{ world }}
{% endraw %}
```

````
```
Hello {{ world }}
```
````

## ENOSPC 错误 (Linux)

运行 `$ hexo server` 命令有时会返回这样的错误:
Expand Down
57 changes: 55 additions & 2 deletions source/zh-tw/docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,67 @@ $ hexo clean

## 脫逸(Escape)內容

Hexo 使用 [Nunjucks] 來解析文章(舊版本使用 [Swig],兩者語法類似),內容若包含 `{% raw %}{{ }}{% endraw %}``{% raw %}{% %}{% endraw %}` 可能導致解析錯誤,您可以用 `raw` 標籤包裹來避免潛在問題發生
Hexo 使用 [Nunjucks] 來解析文章(舊版本使用 [Swig],兩者語法類似),內容若包含 `{{ }}``{% %}` 可能導致解析錯誤,您可以用 [`raw`](/docs/tag-plugins#Raw) 標籤包裹,single backtick ```` `{{ }}` ```` 或 triple backtick 來避免潛在問題發生

```
{% raw %}
Hello {{ sensitive }}
Hello {{ world }}
{% endraw %}
```

````
```
Hello {{ world }}
```
````

## ENOSPC Error (Linux)

Sometimes when running the command `$ hexo server` it returns an error:
```
Error: watch ENOSPC ...
```
It can be fixed by running `$ npm dedupe` or, if that doesn't help, try the following in the Linux console:
```
$ echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
```
This will increase the limit for the number of files you can watch.

## EMPERM Error (Windows Subsystem for Linux)

When running `$ hexo server` in a BashOnWindows environment, it returns the following error:
```
Error: watch /path/to/hexo/theme/ EMPERM
```
Unfortunately, WSL does not currently support filesystem watchers. Therefore, the live updating feature of hexo's server is currently unavailable. You can still run the server from a WSL environment by first generating the files and then running it as a static server:
``` sh
$ hexo generate
$ hexo server -s
```
This is [a known BashOnWindows issue](https://github.com/Microsoft/BashOnWindows/issues/216), and on 15 Aug 2016, the Windows team said they would work on it. You can get progress updates and encourage them to prioritize it on [the issue's UserVoice suggestion page](https://wpdev.uservoice.com/forums/266908-command-prompt-console-bash-on-ubuntu-on-windo/suggestions/13469097-support-for-filesystem-watchers-like-inotify).

## Template render error

Sometimes when running the command `$ hexo generate` it returns an error:
```
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Template render error: (unknown path)
```
It means that there are some unrecognizable words in your file, e.g. invisible zero width characters. There are two possibilities One is your new page/post, and the other one is `_config.yml`.
In `_config.yml`, don't forget add whitespace before a list in hash. There is the wiki page about [YAML](https://en.wikipedia.org/wiki/YAML).
The error one:
```
plugins:
- hexo-generator-feed
- hexo-generator-sitemap
```
The correct one:
```
plugins:
- hexo-generator-feed
- hexo-generator-sitemap
```

[Warehouse]: https://github.com/hexojs/warehouse
[Swig]: http://paularmstrong.github.io/swig/
[Nunjucks]: http://mozilla.github.io/nunjucks/

0 comments on commit 8832c75

Please sign in to comment.