1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-11-24 07:30:12 +01:00

Merge pull request #70 from brendo/fix-no-repo-header

Handle when no config.repo_url is available
This commit is contained in:
Martin Donath 2016-12-19 18:18:23 +01:00 committed by GitHub
commit f2662fad38
4 changed files with 14 additions and 12 deletions

View File

@ -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();

View File

@ -34,14 +34,14 @@
{% endblock %}
</div>
<div class="md-flex__cell md-flex__cell--shrink">
<div class="md-header-nav__source">
{% block repo %}
{% if config.repo_url %}
<div class="md-header-nav__source">
{% include "partials/source.html" %}
</div>
{% endif %}
{% endblock %}
</div>
</div>
</div>
</nav>
</header>

View File

@ -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([])

View File

@ -74,14 +74,14 @@
<!-- Repository containing source -->
<div class="md-flex__cell md-flex__cell--shrink">
<div class="md-header-nav__source">
{% block repo %}
{% if config.repo_url %}
<div class="md-header-nav__source">
{% include "partials/source.html" %}
</div>
{% endif %}
{% endblock %}
</div>
</div>
</div>
</nav>
</header>