now only import libraries to highlight code when code exists in post
parent
a2adab7c7d
commit
d1558df51a
|
@ -3,7 +3,9 @@
|
|||
|
||||
{% block extracss %}
|
||||
<link href="/static/css/post.css" rel="stylesheet"/>
|
||||
{% if post.content is containing("<code>") %}
|
||||
<link href="/static/css/highlightjs/agate.css" rel="stylesheet"/>
|
||||
{% endif %}
|
||||
{% endblock extracss %}
|
||||
|
||||
{% block content %}
|
||||
|
@ -20,8 +22,10 @@
|
|||
{% endblock content %}
|
||||
|
||||
{% block extrajs %}
|
||||
<script src="/static/js/highlight.pack.js"></script>
|
||||
<script>
|
||||
{% if post.content is containing("<code>") %}
|
||||
<script src="/static/js/highlight.pack.js"></script>
|
||||
<script>
|
||||
hljs.initHighlightingOnLoad();
|
||||
</script>
|
||||
</script>
|
||||
{% endif %}
|
||||
{% endblock extrajs %}
|
||||
|
|
Loading…
Reference in New Issue