template tweak

This commit is contained in:
Pig Fang 2020-05-21 11:22:56 +08:00
parent d1afc6645c
commit cccaef302a
2 changed files with 11 additions and 5 deletions

View File

@ -1,7 +1,9 @@
{% for script in scripts %}
<script{% for attribute, value in script %} {{ attribute }}="{{ value }}"{% endfor %}></script>
{% endfor %}
<script>
{{ inline_js|striptags('<div><span><ul><li><p><a><img><i>')|raw }}
</script>
{% if inline_js %}
<script>
{{ inline_js|striptags('<div><span><ul><li><p><a><img><i>')|raw }}
</script>
{% endif %}
{{ extra_foot|join('\n')|raw }}

View File

@ -7,7 +7,9 @@
<meta name="description" content="{{ seo.description }}">
{{ seo.extra|striptags('<meta>')|raw }}
<link rel="preconnect" href="https://cdn.jsdelivr.net/" crossorigin>
<link rel="preconnect" href="{{ custom_cdn_host }}" crossorigin>
{% if custom_cdn_host %}
<link rel="preconnect" href="{{ custom_cdn_host }}" crossorigin>
{% endif %}
<script>
window.addEventListener('load', () => {
navigator.serviceWorker.register('/sw.js?v1')
@ -19,5 +21,7 @@ window.addEventListener('load', () => {
<link rel="shortcut icon" href="{{ favicon }}">
<link rel="icon" type="image/png" href="{{ favicon }}" sizes="192x192">
<link rel="apple-touch-icon" href="{{ favicon }}" sizes="180x180">
<style>{{ inline_css|striptags }}</style>
{% if inline_css %}
<style>{{ inline_css|striptags }}</style>
{% endif %}
{{ extra_head|join('\n')|raw }}