mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Merge pull request #70 from brendo/fix-no-repo-header
Handle when no config.repo_url is available
This commit is contained in:
commit
f2662fad38
@ -739,6 +739,7 @@ var Application =
|
||||
/* Retrieve the facts for the given repository type */
|
||||
;(function () {
|
||||
var el = document.querySelector("[data-md-source]");
|
||||
if (!el) return Promise.resolve([]);
|
||||
switch (el.dataset.mdSource) {
|
||||
case "github":
|
||||
return new _Material2.default.Source.Adapter.GitHub(el).fetch();
|
||||
|
@ -34,13 +34,13 @@
|
||||
{% endblock %}
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<div class="md-header-nav__source">
|
||||
{% block repo %}
|
||||
{% if config.repo_url %}
|
||||
{% block repo %}
|
||||
{% if config.repo_url %}
|
||||
<div class="md-header-nav__source">
|
||||
{% include "partials/source.html" %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
@ -196,6 +196,7 @@ export default class Application {
|
||||
/* Retrieve the facts for the given repository type */
|
||||
;(() => {
|
||||
const el = document.querySelector("[data-md-source]")
|
||||
if (!el) return Promise.resolve([])
|
||||
switch (el.dataset.mdSource) {
|
||||
case "github": return new Material.Source.Adapter.GitHub(el).fetch()
|
||||
default: return Promise.resolve([])
|
||||
|
@ -74,13 +74,13 @@
|
||||
|
||||
<!-- Repository containing source -->
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<div class="md-header-nav__source">
|
||||
{% block repo %}
|
||||
{% if config.repo_url %}
|
||||
{% block repo %}
|
||||
{% if config.repo_url %}
|
||||
<div class="md-header-nav__source">
|
||||
{% include "partials/source.html" %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
Loading…
Reference in New Issue
Block a user