Refactored search configuration

This commit is contained in:
squidfunk 2020-03-27 16:51:27 +01:00
parent 9e74bb7a32
commit 635343544e
7 changed files with 18 additions and 24 deletions

View File

@ -1,10 +1,10 @@
{ {
"assets/javascripts/bundle.js": "assets/javascripts/bundle.659deb65.min.js", "assets/javascripts/bundle.js": "assets/javascripts/bundle.b5589e46.min.js",
"assets/javascripts/bundle.js.map": "assets/javascripts/bundle.659deb65.min.js.map", "assets/javascripts/bundle.js.map": "assets/javascripts/bundle.b5589e46.min.js.map",
"assets/javascripts/vendor.js": "assets/javascripts/vendor.3340e0de.min.js", "assets/javascripts/vendor.js": "assets/javascripts/vendor.3340e0de.min.js",
"assets/javascripts/vendor.js.map": "assets/javascripts/vendor.3340e0de.min.js.map", "assets/javascripts/vendor.js.map": "assets/javascripts/vendor.3340e0de.min.js.map",
"assets/javascripts/worker/search.js": "assets/javascripts/worker/search.0ec816aa.min.js", "assets/javascripts/worker/search.js": "assets/javascripts/worker/search.3bc815f0.min.js",
"assets/javascripts/worker/search.js.map": "assets/javascripts/worker/search.0ec816aa.min.js.map", "assets/javascripts/worker/search.js.map": "assets/javascripts/worker/search.3bc815f0.min.js.map",
"assets/stylesheets/main.css": "assets/stylesheets/main.b32d3181.min.css", "assets/stylesheets/main.css": "assets/stylesheets/main.b32d3181.min.css",
"assets/stylesheets/palette.css": "assets/stylesheets/palette.4444686e.min.css" "assets/stylesheets/palette.css": "assets/stylesheets/palette.4444686e.min.css"
} }

View File

@ -173,12 +173,9 @@
{% include "partials/footer.html" %} {% include "partials/footer.html" %}
{% endblock %} {% endblock %}
</div> </div>
{% block config %}
<script>var __config={}</script>
{% endblock %}
{% block scripts %} {% block scripts %}
<script src="{{ 'assets/javascripts/vendor.3340e0de.min.js' | url }}"></script> <script src="{{ 'assets/javascripts/vendor.3340e0de.min.js' | url }}"></script>
<script src="{{ 'assets/javascripts/bundle.659deb65.min.js' | url }}"></script> <script src="{{ 'assets/javascripts/bundle.b5589e46.min.js' | url }}"></script>
{%- set translations = {} -%} {%- set translations = {} -%}
{%- for key in [ {%- for key in [
"clipboard.copy", "clipboard.copy",
@ -196,13 +193,14 @@
<script id="__lang" type="application/json"> <script id="__lang" type="application/json">
{{- translations | tojson -}} {{- translations | tojson -}}
</script> </script>
{% block config %}{% endblock %}
<script> <script>
app = initialize({ app = initialize({
base: "{{ base_url }}", base: "{{ base_url }}",
features: {{ config.theme.features | tojson }}, features: {{ config.theme.features | tojson }},
search: { search: Object.assign({
worker: "{{ 'assets/javascripts/worker/search.0ec816aa.min.js' | url }}" worker: "{{ 'assets/javascripts/worker/search.3bc815f0.min.js' | url }}"
} }, typeof search !== "undefined" && search)
}) })
</script> </script>
{% for path in config["extra_javascript"] %} {% for path in config["extra_javascript"] %}

View File

@ -337,13 +337,6 @@
{% endblock %} {% endblock %}
</div> </div>
<!-- Application configuration -->
{% block config %}
<script>
var __config = {}
</script>
{% endblock %}
<!-- Theme-related JavaScript --> <!-- Theme-related JavaScript -->
{% block scripts %} {% block scripts %}
<script src="{{ 'assets/javascripts/vendor.js' | url }}"></script> <script src="{{ 'assets/javascripts/vendor.js' | url }}"></script>
@ -368,14 +361,17 @@
{{- translations | tojson -}} {{- translations | tojson -}}
</script> </script>
<!-- Application configuration -->
{% block config %}{% endblock %}
<!-- Application initialization --> <!-- Application initialization -->
<script> <script>
app = initialize({ app = initialize({
base: "{{ base_url }}", base: "{{ base_url }}",
features: {{ config.theme.features | tojson }}, features: {{ config.theme.features | tojson }},
search: { search: Object.assign({
worker: "{{ 'assets/javascripts/worker/search.js' | url }}" worker: "{{ 'assets/javascripts/worker/search.js' | url }}"
} }, typeof search !== "undefined" && search)
}) })
</script> </script>