Skip to content

Commit

Permalink
Refactored search configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
squidfunk committed Mar 27, 2020
1 parent 9e74bb7 commit 6353435
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 24 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions material/assets/manifest.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"assets/javascripts/bundle.js": "assets/javascripts/bundle.659deb65.min.js",
"assets/javascripts/bundle.js.map": "assets/javascripts/bundle.659deb65.min.js.map",
"assets/javascripts/bundle.js": "assets/javascripts/bundle.b5589e46.min.js",
"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.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.map": "assets/javascripts/worker/search.0ec816aa.min.js.map",
"assets/javascripts/worker/search.js": "assets/javascripts/worker/search.3bc815f0.min.js",
"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/palette.css": "assets/stylesheets/palette.4444686e.min.css"
}
12 changes: 5 additions & 7 deletions material/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,9 @@ <h1>{{ page.title | default(config.site_name, true)}}</h1>
{% include "partials/footer.html" %}
{% endblock %}
</div>
{% block config %}
<script>var __config={}</script>
{% endblock %}
{% block scripts %}
<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 = {} -%}
{%- for key in [
"clipboard.copy",
Expand All @@ -196,13 +193,14 @@ <h1>{{ page.title | default(config.site_name, true)}}</h1>
<script id="__lang" type="application/json">
{{- translations | tojson -}}
</script>
{% block config %}{% endblock %}
<script>
app = initialize({
base: "{{ base_url }}",
features: {{ config.theme.features | tojson }},
search: {
worker: "{{ 'assets/javascripts/worker/search.0ec816aa.min.js' | url }}"
}
search: Object.assign({
worker: "{{ 'assets/javascripts/worker/search.3bc815f0.min.js' | url }}"
}, typeof search !== "undefined" && search)
})
</script>
{% for path in config["extra_javascript"] %}
Expand Down
14 changes: 5 additions & 9 deletions src/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -337,13 +337,6 @@ <h1>{{ page.title | default(config.site_name, true)}}</h1>
{% endblock %}
</div>

<!-- Application configuration -->
{% block config %}
<script>
var __config = {}
</script>
{% endblock %}

<!-- Theme-related JavaScript -->
{% block scripts %}
<script src="{{ 'assets/javascripts/vendor.js' | url }}"></script>
Expand All @@ -368,14 +361,17 @@ <h1>{{ page.title | default(config.site_name, true)}}</h1>
{{- translations | tojson -}}
</script>

<!-- Application configuration -->
{% block config %}{% endblock %}

<!-- Application initialization -->
<script>
app = initialize({
base: "{{ base_url }}",
features: {{ config.theme.features | tojson }},
search: {
search: Object.assign({
worker: "{{ 'assets/javascripts/worker/search.js' | url }}"
}
}, typeof search !== "undefined" && search)
})
</script>

Expand Down

0 comments on commit 6353435

Please sign in to comment.