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