gitbook template render error unknown block tag: static

2.1k views Asked by At

in my markdown file has these lines:

```python
<link rel="stylesheet" href="{% static 'css/xxx.css' %}">
<script src="{% static 'js/xxx.js' %}"> </script>
```

however, gitbook get error, like:

Template render error: (D:\my\django-toturial\template_base.md) [Line 29, Column 15] unknown block tag: static (In file 'template_base.md')

why gitbook reserve static as a tag in my markdown files.,how to resolve this problme.

1

There are 1 answers

0
fandi On

I think it conflicts with templating used by Gitbook https://toolchain.gitbook.com/templating/

To fix this you can use {% raw %} {% endraw %} between "{% static 'js/xxx.js' %}"