CLICKHOUSE-3067: less laggy single page documentation

This commit is contained in:
Ivan Blinkov 2017-08-04 12:05:38 +03:00
parent 50cbb31406
commit bb4116236f
4 changed files with 24 additions and 2 deletions

View File

@ -72,7 +72,7 @@
clickmap:true,
trackLinks:true,
accurateTrackBounce:true,
webvisor:true
webvisor: {% if builder != "singlehtml" %}true{% else %}false{% endif %}
});
} catch(e) { }
});
@ -93,5 +93,11 @@
<div><img src="https://mc.yandex.ru/watch/18343495" style="position:absolute; left:-9999px;" alt=""/></div>
</noscript>
<!-- /Yandex.Metrika counter -->
{% if builder == "singlehtml" %}
<script type="text/javascript" async="async">
$(function() {
$(".body").html({{ body|escapejs }});
});
</script>
{% endif %}
{%- endblock %}

6
docs/_templates/page.html vendored Normal file
View File

@ -0,0 +1,6 @@
{%- extends "layout.html" %}
{% block body %}
{% if builder != "singlehtml" %}
{{ body }}
{% endif %}
{% endblock %}

View File

@ -292,5 +292,10 @@ texinfo_documents = [
# If true, do not generate a @detailmenu in the "Top" node's menu.
#texinfo_no_detailmenu = False
def add_filters(app):
import json
app.builder.templates.environment.filters[str('escapejs')] = lambda x: json.dumps(unicode(x))
def setup(app):
app.add_javascript('custom.js')
app.connect(str('builder-inited'), add_filters)

View File

@ -292,5 +292,10 @@ texinfo_documents = [
# If true, do not generate a @detailmenu in the "Top" node's menu.
#texinfo_no_detailmenu = False
def add_filters(app):
import json
app.builder.templates.environment.filters[str('escapejs')] = lambda x: json.dumps(unicode(x))
def setup(app):
app.add_javascript('custom.js')
app.connect(str('builder-inited'), add_filters)