Fixed basic authentication for search index retrieval

This commit is contained in:
squidfunk 2017-01-06 18:19:15 +01:00
parent 33c183754c
commit b273c429d9
5 changed files with 11 additions and 10 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -36,7 +36,7 @@
{% include "partials/fonts.html" %} {% include "partials/fonts.html" %}
{% endblock %} {% endblock %}
{% block styles %} {% block styles %}
<link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application-868145bb77.css"> <link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application-0d18cb003b.css">
{% if config.extra.palette %} {% if config.extra.palette %}
<link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application-0352baa348.palette.css"> <link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application-0352baa348.palette.css">
{% endif %} {% endif %}
@ -110,7 +110,7 @@
<script src="https://cdn.mathjax.org/{{ path }}"></script> <script src="https://cdn.mathjax.org/{{ path }}"></script>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
<script src="{{ base_url }}/assets/javascripts/application-c57ff8e45a.js"></script> <script src="{{ base_url }}/assets/javascripts/application-c6a54b6fec.js"></script>
<script>var config={url:{base:"{{ base_url }}"}},app=new Application(config);app.initialize()</script> <script>var config={url:{base:"{{ base_url }}"}},app=new Application(config);app.initialize()</script>
{% for path in extra_javascript %} {% for path in extra_javascript %}
<script src="{{ path }}"></script> <script src="{{ path }}"></script>

View File

@ -141,8 +141,9 @@ export default class Application {
new Material.Event.Listener(document.forms.search.query, [ new Material.Event.Listener(document.forms.search.query, [
"focus", "keyup" "focus", "keyup"
], new Material.Search.Result("[data-md-component=result]", () => { ], new Material.Search.Result("[data-md-component=result]", () => {
return fetch(`${this.config_.url.base}/mkdocs/search_index.json`) return fetch(`${this.config_.url.base}/mkdocs/search_index.json`, {
.then(response => response.json()) credentials: "same-origin"
}).then(response => response.json())
.then(data => { .then(data => {
return data.docs.map(doc => { return data.docs.map(doc => {
doc.location = this.config_.url.base + doc.location doc.location = this.config_.url.base + doc.location