Closed sanel closed 7 years ago
When :klipse is set to {} (or not present at all) in config.edn, it will emit this code:
:klipse
{}
config.edn
<link rel="stylesheet" type="text/css" href=nil> <script> window.klipse_settings = null; </script> <script src=nil></script>
where browser will fail with GET request for given resource, which is nil. Here is a small patch to mitigate this (I've added it against blue_centered theme, but should be applicable to other themes as well):
GET
nil
blue_centered
--- a/resources/templates/themes/blue_centered/html/base.html +++ b/resources/templates/themes/blue_centered/html/base.html @@ -86,7 +86,9 @@ <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script> {% script "js/highlight.pack.js" %} <script>hljs.initHighlightingOnLoad();</script> +{% if klipse|not-empty %} {% if post.klipse %} {{post.klipse|safe}} {% endif %} {% if page.klipse %} {{page.klipse|safe}} {% endif %} +{% endif %} </body> </html>
Thanks for the patch. I'll look at applying it to the rest of the themes when I get a chance.
I think it may be better to solve this further upstream, so you don't need to do this in every theme.
When
:klipse
is set to{}
(or not present at all) inconfig.edn
, it will emit this code:where browser will fail with
GET
request for given resource, which isnil
. Here is a small patch to mitigate this (I've added it againstblue_centered
theme, but should be applicable to other themes as well):