mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Fixed meta source only rendering first character
This commit is contained in:
parent
e8200730b3
commit
a0308b0dce
@ -73,16 +73,7 @@ is defined inside the project's `mkdocs.yml`, the files can be linked using the
|
|||||||
source: file.js
|
source: file.js
|
||||||
```
|
```
|
||||||
|
|
||||||
A new entry at the bottom of the table of contents is generated that is linking
|
The filename is appended to the `repo_url` set in your `mkdocs.yml`, but can
|
||||||
to the section listing the linked source files. Multiple files can be linked by
|
|
||||||
adding filenames on separate lines:
|
|
||||||
|
|
||||||
``` markdown
|
|
||||||
source: file.js
|
|
||||||
file.css
|
|
||||||
```
|
|
||||||
|
|
||||||
The filenames are appended to the `repo_url` set in your `mkdocs.yml`, but can
|
|
||||||
be prefixed with a `path` to ensure correct path resolving:
|
be prefixed with a `path` to ensure correct path resolving:
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
@ -139,12 +139,11 @@
|
|||||||
{% block source %}
|
{% block source %}
|
||||||
{% if page.meta.source %}
|
{% if page.meta.source %}
|
||||||
<h2 id="__source">{{ lang.t("meta.source") }}</h2>
|
<h2 id="__source">{{ lang.t("meta.source") }}</h2>
|
||||||
{% set path = (page.meta.path | default([""]) | first) %}
|
{% set path = (page.meta.path | default([""])) %}
|
||||||
{% for file in page.meta.source %}
|
{% set file = page.meta.source %}
|
||||||
<a href="{{ [config.repo_url, path, file] | join('/') }}" title="{{ file }}" class="md-source-file">
|
<a href="{{ [config.repo_url, path, file] | join('/') }}" title="{{ file }}" class="md-source-file">
|
||||||
{{ file }}
|
{{ file }}
|
||||||
</a>
|
</a>
|
||||||
{% endfor %}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -264,13 +264,12 @@
|
|||||||
{% block source %}
|
{% block source %}
|
||||||
{% if page.meta.source %}
|
{% if page.meta.source %}
|
||||||
<h2 id="__source">{{ lang.t("meta.source") }}</h2>
|
<h2 id="__source">{{ lang.t("meta.source") }}</h2>
|
||||||
{% set path = (page.meta.path | default([""]) | first) %}
|
{% set path = (page.meta.path | default([""])) %}
|
||||||
{% for file in page.meta.source %}
|
{% set file = page.meta.source %}
|
||||||
<a href="{{ [config.repo_url, path, file] | join('/') }}"
|
<a href="{{ [config.repo_url, path, file] | join('/') }}"
|
||||||
title="{{ file }}" class="md-source-file">
|
title="{{ file }}" class="md-source-file">
|
||||||
{{ file }}
|
{{ file }}
|
||||||
</a>
|
</a>
|
||||||
{% endfor %}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
Loading…
Reference in New Issue
Block a user