mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-11-12 01:50:52 +01:00
Fixed backward compatibility for localization
This commit is contained in:
parent
c1e541b32b
commit
9c3134750e
@ -1,3 +1,8 @@
|
|||||||
|
mkdocs-material-1.11.0 (2017-10-19)
|
||||||
|
|
||||||
|
* Added localization to clipboard
|
||||||
|
* Refactored i18n localization logic
|
||||||
|
|
||||||
mkdocs-material-1.10.4 (2017-10-18)
|
mkdocs-material-1.10.4 (2017-10-18)
|
||||||
|
|
||||||
* Improved print styles of code blocks
|
* Improved print styles of code blocks
|
||||||
|
@ -386,6 +386,8 @@ macro `t`:
|
|||||||
``` jinja
|
``` jinja
|
||||||
{% macro t(key) %}{{ {
|
{% macro t(key) %}{{ {
|
||||||
"language": "en",
|
"language": "en",
|
||||||
|
"clipboard.copy": "Copy to clipboard",
|
||||||
|
"clipboard.copied": "Copied to clipboard",
|
||||||
"edit.link.title": "Edit this page",
|
"edit.link.title": "Edit this page",
|
||||||
"footer.previous": "Previous",
|
"footer.previous": "Previous",
|
||||||
"footer.next": "Next",
|
"footer.next": "Next",
|
||||||
@ -486,7 +488,7 @@ but highly recommended, so they should be switched on at all times:
|
|||||||
``` yaml
|
``` yaml
|
||||||
markdown_extensions:
|
markdown_extensions:
|
||||||
- admonition
|
- admonition
|
||||||
- codehilite:
|
- codehilite:
|
||||||
guess_lang: false
|
guess_lang: false
|
||||||
- toc:
|
- toc:
|
||||||
permalink: true
|
permalink: true
|
||||||
|
@ -12,11 +12,16 @@ To determine the currently installed version, use the following command:
|
|||||||
|
|
||||||
``` sh
|
``` sh
|
||||||
pip show mkdocs-material | grep -E ^Version
|
pip show mkdocs-material | grep -E ^Version
|
||||||
# Version 1.10.4
|
# Version 1.11.0
|
||||||
```
|
```
|
||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
|
### 1.11.0 <small>_ October 19, 2017</small>
|
||||||
|
|
||||||
|
* Added localization to clipboard
|
||||||
|
* Refactored i18n localization logic
|
||||||
|
|
||||||
### 1.10.4 <small>_ October 18, 2017</small>
|
### 1.10.4 <small>_ October 18, 2017</small>
|
||||||
|
|
||||||
* Improved print styles of code blocks
|
* Improved print styles of code blocks
|
||||||
|
@ -10,6 +10,8 @@ The translations can be changed in `theme/partials/language.html`:
|
|||||||
``` jinja
|
``` jinja
|
||||||
{% macro t(key) %}{{ {
|
{% macro t(key) %}{{ {
|
||||||
"language": "de",
|
"language": "de",
|
||||||
|
"clipboard.copy": "In Zwischenablage kopieren",
|
||||||
|
"clipboard.copied": "In Zwischenablage kopiert",
|
||||||
"edit.link.title": "Seite editieren",
|
"edit.link.title": "Seite editieren",
|
||||||
"footer.previous": "Vorherige Seite",
|
"footer.previous": "Vorherige Seite",
|
||||||
"footer.next": "Nächste Seite",
|
"footer.next": "Nächste Seite",
|
||||||
|
@ -23,6 +23,8 @@
|
|||||||
<!-- Translations -->
|
<!-- Translations -->
|
||||||
{% macro t(key) %}{{ {
|
{% macro t(key) %}{{ {
|
||||||
"language": "de",
|
"language": "de",
|
||||||
|
"clipboard.copy": "In Zwischenablage kopieren",
|
||||||
|
"clipboard.copied": "In Zwischenablage kopiert",
|
||||||
"edit.link.title": "Seite editieren",
|
"edit.link.title": "Seite editieren",
|
||||||
"footer.previous": "Vorherige Seite",
|
"footer.previous": "Vorherige Seite",
|
||||||
"footer.next": "Nächste Seite",
|
"footer.next": "Nächste Seite",
|
||||||
|
1
material/assets/javascripts/application-268d62d82d.js
Normal file
1
material/assets/javascripts/application-268d62d82d.js
Normal file
File diff suppressed because one or more lines are too long
@ -20,22 +20,22 @@
|
|||||||
<meta name="author" content="{{ config.site_author }}">
|
<meta name="author" content="{{ config.site_author }}">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% for key in [
|
{% for key in [
|
||||||
"clipboard-copy",
|
"clipboard.copy",
|
||||||
"clipboard-copied",
|
"clipboard.copied",
|
||||||
"search-languages",
|
"search.languages",
|
||||||
"search-result-none",
|
"search.result.none",
|
||||||
"search-result-one",
|
"search.result.one",
|
||||||
"search-result-other",
|
"search.result.other",
|
||||||
"search-tokenizer"
|
"search.tokenizer"
|
||||||
] %}
|
] %}
|
||||||
<meta name="i18n-{{ key }}" content="{{ lang.t(key) }}">
|
<meta name="lang:{{ key }}" content="{{ lang.t(key) }}">
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% if config.site_favicon %}
|
{% if config.site_favicon %}
|
||||||
<link rel="shortcut icon" href="{{ base_url }}/{{ config.site_favicon }}">
|
<link rel="shortcut icon" href="{{ base_url }}/{{ config.site_favicon }}">
|
||||||
{% else %}
|
{% else %}
|
||||||
<link rel="shortcut icon" href="{{ base_url }}/assets/images/favicon.png">
|
<link rel="shortcut icon" href="{{ base_url }}/assets/images/favicon.png">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<meta name="generator" content="mkdocs-{{ mkdocs_version }}, mkdocs-material-1.10.4">
|
<meta name="generator" content="mkdocs-{{ mkdocs_version }}, mkdocs-material-1.11.0">
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block htmltitle %}
|
{% block htmltitle %}
|
||||||
{% if page and page.meta.title %}
|
{% if page and page.meta.title %}
|
||||||
@ -131,7 +131,7 @@
|
|||||||
<article class="md-content__inner md-typeset">
|
<article class="md-content__inner md-typeset">
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% if config.edit_uri %}
|
{% if config.edit_uri %}
|
||||||
<a href="{{ page.edit_url }}" title="{{ lang.t('edit-link-title') }}" class="md-icon md-content__icon"></a>
|
<a href="{{ page.edit_url }}" title="{{ lang.t('edit.link.title') }}" class="md-icon md-content__icon"></a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if not "\x3ch1" in page.content %}
|
{% if not "\x3ch1" in page.content %}
|
||||||
<h1>{{ page.title | default(config.site_name, true)}}</h1>
|
<h1>{{ page.title | default(config.site_name, true)}}</h1>
|
||||||
@ -139,7 +139,7 @@
|
|||||||
{{ page.content }}
|
{{ page.content }}
|
||||||
{% 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([""]) | first) %}
|
||||||
{% for file in page.meta.source %}
|
{% for file in 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">
|
||||||
@ -151,7 +151,7 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block disqus %}
|
{% block disqus %}
|
||||||
{% if config.extra.disqus and not page.is_homepage %}
|
{% if config.extra.disqus and not page.is_homepage %}
|
||||||
<h2 id="__comments">{{ lang.t("meta-comments") }}</h2>
|
<h2 id="__comments">{{ lang.t("meta.comments") }}</h2>
|
||||||
{% include "partials/disqus.html" %}
|
{% include "partials/disqus.html" %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
@ -164,8 +164,8 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
</div>
|
</div>
|
||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
<script src="{{ base_url }}/assets/javascripts/application-ff1c1336b6.js"></script>
|
<script src="{{ base_url }}/assets/javascripts/application-268d62d82d.js"></script>
|
||||||
{% set languages = lang.t("search-languages").split(",") %}
|
{% set languages = lang.t("search.languages").split(",") %}
|
||||||
{% if languages | length and languages[0] != "" %}
|
{% if languages | length and languages[0] != "" %}
|
||||||
{% set path = base_url + "/assets/javascripts/lunr" %}
|
{% set path = base_url + "/assets/javascripts/lunr" %}
|
||||||
<script src="{{ path }}/lunr.stemmer.support.js"></script>
|
<script src="{{ path }}/lunr.stemmer.support.js"></script>
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
|
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
|
||||||
<span class="md-flex__ellipsis">
|
<span class="md-flex__ellipsis">
|
||||||
<span class="md-footer-nav__direction">
|
<span class="md-footer-nav__direction">
|
||||||
{{ lang.t("footer-previous") }}
|
{{ lang.t("footer.previous") }}
|
||||||
</span>
|
</span>
|
||||||
{{ page.previous_page.title }}
|
{{ page.previous_page.title }}
|
||||||
</span>
|
</span>
|
||||||
@ -23,7 +23,7 @@
|
|||||||
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
|
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
|
||||||
<span class="md-flex__ellipsis">
|
<span class="md-flex__ellipsis">
|
||||||
<span class="md-footer-nav__direction">
|
<span class="md-footer-nav__direction">
|
||||||
{{ lang.t("footer-next") }}
|
{{ lang.t("footer.next") }}
|
||||||
</span>
|
</span>
|
||||||
{{ page.next_page.title }}
|
{{ page.next_page.title }}
|
||||||
</span>
|
</span>
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
{% macro t(key) %}{{ {
|
{% macro t(key) %}{{ {
|
||||||
"language": "en",
|
"language": "en",
|
||||||
"clipboard-copy": "Copy to clipboard",
|
"clipboard.copy": "Copy to clipboard",
|
||||||
"clipboard-copied": "Copied to clipboard",
|
"clipboard.copied": "Copied to clipboard",
|
||||||
"edit-link-title": "Edit this page",
|
"edit.link.title": "Edit this page",
|
||||||
"footer-previous": "Previous",
|
"footer.previous": "Previous",
|
||||||
"footer-next": "Next",
|
"footer.next": "Next",
|
||||||
"meta-comments": "Comments",
|
"meta.comments": "Comments",
|
||||||
"meta-source": "Source",
|
"meta.source": "Source",
|
||||||
"search-languages": "",
|
"search.languages": "",
|
||||||
"search-placeholder": "Search",
|
"search.placeholder": "Search",
|
||||||
"search-result-placeholder": "Type to start searching",
|
"search.result.placeholder": "Type to start searching",
|
||||||
"search-result-none": "No matching documents",
|
"search.result.none": "No matching documents",
|
||||||
"search-result-one": "1 matching document",
|
"search.result.one": "1 matching document",
|
||||||
"search-result-other": "# matching documents",
|
"search.result.other": "# matching documents",
|
||||||
"search-tokenizer": "[\s\-]+",
|
"search.tokenizer": "[\s\-]+",
|
||||||
"source-link-title": "Go to repository",
|
"source.link.title": "Go to repository",
|
||||||
"toc-title": "Table of contents"
|
"toc.title": "Table of contents"
|
||||||
}[key] }}{% endmacro %}
|
}[key] }}{% endmacro %}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<label class="md-search__overlay" for="search"></label>
|
<label class="md-search__overlay" for="search"></label>
|
||||||
<div class="md-search__inner">
|
<div class="md-search__inner">
|
||||||
<form class="md-search__form" name="search">
|
<form class="md-search__form" name="search">
|
||||||
<input type="text" class="md-search__input" name="query" required placeholder="{{ lang.t('search-placeholder') }}" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query">
|
<input type="text" class="md-search__input" name="query" required placeholder="{{ lang.t('search.placeholder') }}" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query">
|
||||||
<label class="md-icon md-search__icon" for="search"></label>
|
<label class="md-icon md-search__icon" for="search"></label>
|
||||||
<button type="reset" class="md-icon md-search__icon" data-md-component="reset"></button>
|
<button type="reset" class="md-icon md-search__icon" data-md-component="reset"></button>
|
||||||
</form>
|
</form>
|
||||||
@ -11,7 +11,7 @@
|
|||||||
<div class="md-search__scrollwrap" data-md-scrollfix>
|
<div class="md-search__scrollwrap" data-md-scrollfix>
|
||||||
<div class="md-search-result" data-md-component="result">
|
<div class="md-search-result" data-md-component="result">
|
||||||
<div class="md-search-result__meta">
|
<div class="md-search-result__meta">
|
||||||
{{ lang.t("search-result-placeholder") }}
|
{{ lang.t("search.result.placeholder") }}
|
||||||
</div>
|
</div>
|
||||||
<ol class="md-search-result__list"></ol>
|
<ol class="md-search-result__list"></ol>
|
||||||
</div>
|
</div>
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
{% set repo_type = "" %}
|
{% set repo_type = "" %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% block repo %}
|
{% block repo %}
|
||||||
<a href="{{ config.repo_url }}" title="{{ lang.t('source-link-title') }}" class="md-source" data-md-source="{{ repo_type }}">
|
<a href="{{ config.repo_url }}" title="{{ lang.t('source.link.title') }}" class="md-source" data-md-source="{{ repo_type }}">
|
||||||
{% if repo_type %}
|
{% if repo_type %}
|
||||||
<div class="md-source__icon">
|
<div class="md-source__icon">
|
||||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||||
|
@ -5,22 +5,22 @@
|
|||||||
{% set toc_ = (toc_ | first).children %}
|
{% set toc_ = (toc_ | first).children %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if toc_ | first is defined %}
|
{% if toc_ | first is defined %}
|
||||||
<label class="md-nav__title" for="toc">{{ lang.t("toc-title") }}</label>
|
<label class="md-nav__title" for="toc">{{ lang.t("toc.title") }}</label>
|
||||||
<ul class="md-nav__list" data-md-scrollfix>
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
{% for toc_item in toc_ %}
|
{% for toc_item in toc_ %}
|
||||||
{% include "partials/toc-item.html" %}
|
{% include "partials/toc-item.html" %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% if page.meta.source and page.meta.source | length > 0 %}
|
{% if page.meta.source and page.meta.source | length > 0 %}
|
||||||
<li class="md-nav__item">
|
<li class="md-nav__item">
|
||||||
<a href="#__source" title="{{ lang.t('meta-source') }}" class="md-nav__link md-nav__link--active">
|
<a href="#__source" title="{{ lang.t('meta.source') }}" class="md-nav__link md-nav__link--active">
|
||||||
{{ lang.t("meta-source") }}
|
{{ lang.t("meta.source") }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if config.extra.disqus and not page.is_homepage %}
|
{% if config.extra.disqus and not page.is_homepage %}
|
||||||
<li class="md-nav__item">
|
<li class="md-nav__item">
|
||||||
<a href="#__comments" title="{{ lang.t('meta-comments') }}" class="md-nav__link md-nav__link--active">
|
<a href="#__comments" title="{{ lang.t('meta.comments') }}" class="md-nav__link md-nav__link--active">
|
||||||
{{ lang.t("meta-comments") }}
|
{{ lang.t("meta.comments") }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "mkdocs-material",
|
"name": "mkdocs-material",
|
||||||
"version": "1.10.4",
|
"version": "1.11.0",
|
||||||
"description": "A Material Design theme for MkDocs",
|
"description": "A Material Design theme for MkDocs",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"mkdocs",
|
"mkdocs",
|
||||||
|
@ -37,8 +37,8 @@ import Material from "./components/Material"
|
|||||||
*
|
*
|
||||||
* @return {string} Meta content value
|
* @return {string} Meta content value
|
||||||
*/
|
*/
|
||||||
const i18n = (key, _) => { // eslint-disable-line no-unused-vars
|
const translate = (key, _) => { // eslint-disable-line no-unused-vars
|
||||||
const meta = document.querySelector(`[name=i18n-${key}]`)
|
const meta = document.getElementsByName(`lang:${key}`)[0]
|
||||||
if (!(meta instanceof HTMLMetaElement))
|
if (!(meta instanceof HTMLMetaElement))
|
||||||
throw new ReferenceError
|
throw new ReferenceError
|
||||||
return meta.content
|
return meta.content
|
||||||
@ -92,7 +92,7 @@ function initialize(config) { // eslint-disable-line func-style
|
|||||||
|
|
||||||
/* Create button with message container */
|
/* Create button with message container */
|
||||||
const button = (
|
const button = (
|
||||||
<button class="md-clipboard" title={i18n("clipboard-copy")}
|
<button class="md-clipboard" title={translate("clipboard.copy")}
|
||||||
data-clipboard-target={`#${id} pre, #${id} code`}>
|
data-clipboard-target={`#${id} pre, #${id} code`}>
|
||||||
<span class="md-clipboard__message"></span>
|
<span class="md-clipboard__message"></span>
|
||||||
</button>
|
</button>
|
||||||
@ -120,7 +120,7 @@ function initialize(config) { // eslint-disable-line func-style
|
|||||||
|
|
||||||
/* Set message indicating success and show it */
|
/* Set message indicating success and show it */
|
||||||
message.classList.add("md-clipboard__message--active")
|
message.classList.add("md-clipboard__message--active")
|
||||||
message.innerHTML = i18n("clipboard-copied")
|
message.innerHTML = translate("clipboard.copied")
|
||||||
|
|
||||||
/* Hide message after two seconds */
|
/* Hide message after two seconds */
|
||||||
message.dataset.mdTimer = setTimeout(() => {
|
message.dataset.mdTimer = setTimeout(() => {
|
||||||
|
@ -55,8 +55,8 @@ const truncate = (string, n) => {
|
|||||||
*
|
*
|
||||||
* @return {string} Meta content value
|
* @return {string} Meta content value
|
||||||
*/
|
*/
|
||||||
const i18n = (key, _) => { // eslint-disable-line no-unused-vars
|
const translate = (key, _) => { // eslint-disable-line no-unused-vars
|
||||||
const meta = document.querySelector(`[name=i18n-${key}]`)
|
const meta = document.getElementsByName(`lang:${key}`)[0]
|
||||||
if (!(meta instanceof HTMLMetaElement))
|
if (!(meta instanceof HTMLMetaElement))
|
||||||
throw new ReferenceError
|
throw new ReferenceError
|
||||||
return meta.content
|
return meta.content
|
||||||
@ -106,18 +106,18 @@ export default class Result {
|
|||||||
/* Load messages for metadata display */
|
/* Load messages for metadata display */
|
||||||
this.message_ = {
|
this.message_ = {
|
||||||
placeholder: this.meta_.textContent,
|
placeholder: this.meta_.textContent,
|
||||||
none: i18n("search-result-none"),
|
none: translate("search.result.none"),
|
||||||
one: i18n("search-result-one"),
|
one: translate("search.result.one"),
|
||||||
other: i18n("search-result-other")
|
other: translate("search.result.other")
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Override tokenizer separator, if given */
|
/* Override tokenizer separator, if given */
|
||||||
const tokenizer = i18n("search-tokenizer")
|
const tokenizer = translate("search.tokenizer")
|
||||||
if (tokenizer.length)
|
if (tokenizer.length)
|
||||||
lunr.tokenizer.separator = tokenizer
|
lunr.tokenizer.separator = tokenizer
|
||||||
|
|
||||||
/* Load search languages */
|
/* Load search languages */
|
||||||
this.lang_ = i18n("search-languages").split(",")
|
this.lang_ = translate("search.languages").split(",")
|
||||||
.filter(Boolean)
|
.filter(Boolean)
|
||||||
.map(lang => lang.trim())
|
.map(lang => lang.trim())
|
||||||
}
|
}
|
||||||
|
@ -56,15 +56,15 @@
|
|||||||
|
|
||||||
<!-- Localization -->
|
<!-- Localization -->
|
||||||
{% for key in [
|
{% for key in [
|
||||||
"clipboard-copy",
|
"clipboard.copy",
|
||||||
"clipboard-copied",
|
"clipboard.copied",
|
||||||
"search-languages",
|
"search.languages",
|
||||||
"search-result-none",
|
"search.result.none",
|
||||||
"search-result-one",
|
"search.result.one",
|
||||||
"search-result-other",
|
"search.result.other",
|
||||||
"search-tokenizer"
|
"search.tokenizer"
|
||||||
] %}
|
] %}
|
||||||
<meta name="i18n-{{ key }}" content="{{ lang.t(key) }}" />
|
<meta name="lang:{{ key }}" content="{{ lang.t(key) }}" />
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
<!-- Favicon -->
|
<!-- Favicon -->
|
||||||
@ -247,7 +247,7 @@
|
|||||||
<!-- Edit button, if URL was defined -->
|
<!-- Edit button, if URL was defined -->
|
||||||
{% if config.edit_uri %}
|
{% if config.edit_uri %}
|
||||||
<a href="{{ page.edit_url }}"
|
<a href="{{ page.edit_url }}"
|
||||||
title="{{ lang.t('edit-link-title') }}"
|
title="{{ lang.t('edit.link.title') }}"
|
||||||
class="md-icon md-content__icon"><!-- edit --></a>
|
class="md-icon md-content__icon"><!-- edit --></a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
@ -266,7 +266,7 @@
|
|||||||
<!-- Source files -->
|
<!-- Source files -->
|
||||||
{% 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([""]) | first) %}
|
||||||
{% for file in page.meta.source %}
|
{% for file in page.meta.source %}
|
||||||
<a href="{{ [config.repo_url, path, file] | join('/') }}"
|
<a href="{{ [config.repo_url, path, file] | join('/') }}"
|
||||||
@ -281,7 +281,7 @@
|
|||||||
<!-- Disqus integration -->
|
<!-- Disqus integration -->
|
||||||
{% block disqus %}
|
{% block disqus %}
|
||||||
{% if config.extra.disqus and not page.is_homepage %}
|
{% if config.extra.disqus and not page.is_homepage %}
|
||||||
<h2 id="__comments">{{ lang.t("meta-comments") }}</h2>
|
<h2 id="__comments">{{ lang.t("meta.comments") }}</h2>
|
||||||
{% include "partials/disqus.html" %}
|
{% include "partials/disqus.html" %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
@ -301,7 +301,7 @@
|
|||||||
<script src="{{ base_url }}/assets/javascripts/application.js"></script>
|
<script src="{{ base_url }}/assets/javascripts/application.js"></script>
|
||||||
|
|
||||||
<!-- Load additional languages for search -->
|
<!-- Load additional languages for search -->
|
||||||
{% set languages = lang.t("search-languages").split(",") %}
|
{% set languages = lang.t("search.languages").split(",") %}
|
||||||
{% if languages | length and languages[0] != "" %}
|
{% if languages | length and languages[0] != "" %}
|
||||||
{% set path = base_url + "/assets/javascripts/lunr" %}
|
{% set path = base_url + "/assets/javascripts/lunr" %}
|
||||||
<script src="{{ path }}/lunr.stemmer.support.js"></script>
|
<script src="{{ path }}/lunr.stemmer.support.js"></script>
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
md-footer-nav__title">
|
md-footer-nav__title">
|
||||||
<span class="md-flex__ellipsis">
|
<span class="md-flex__ellipsis">
|
||||||
<span class="md-footer-nav__direction">
|
<span class="md-footer-nav__direction">
|
||||||
{{ lang.t("footer-previous") }}
|
{{ lang.t("footer.previous") }}
|
||||||
</span>
|
</span>
|
||||||
{{ page.previous_page.title }}
|
{{ page.previous_page.title }}
|
||||||
</span>
|
</span>
|
||||||
@ -61,7 +61,7 @@
|
|||||||
md-footer-nav__title">
|
md-footer-nav__title">
|
||||||
<span class="md-flex__ellipsis">
|
<span class="md-flex__ellipsis">
|
||||||
<span class="md-footer-nav__direction">
|
<span class="md-footer-nav__direction">
|
||||||
{{ lang.t("footer-next") }}
|
{{ lang.t("footer.next") }}
|
||||||
</span>
|
</span>
|
||||||
{{ page.next_page.title }}
|
{{ page.next_page.title }}
|
||||||
</span>
|
</span>
|
||||||
|
@ -23,20 +23,20 @@
|
|||||||
<!-- Translations -->
|
<!-- Translations -->
|
||||||
{% macro t(key) %}{{ {
|
{% macro t(key) %}{{ {
|
||||||
"language": "en",
|
"language": "en",
|
||||||
"clipboard-copy": "Copy to clipboard",
|
"clipboard.copy": "Copy to clipboard",
|
||||||
"clipboard-copied": "Copied to clipboard",
|
"clipboard.copied": "Copied to clipboard",
|
||||||
"edit-link-title": "Edit this page",
|
"edit.link.title": "Edit this page",
|
||||||
"footer-previous": "Previous",
|
"footer.previous": "Previous",
|
||||||
"footer-next": "Next",
|
"footer.next": "Next",
|
||||||
"meta-comments": "Comments",
|
"meta.comments": "Comments",
|
||||||
"meta-source": "Source",
|
"meta.source": "Source",
|
||||||
"search-languages": "",
|
"search.languages": "",
|
||||||
"search-placeholder": "Search",
|
"search.placeholder": "Search",
|
||||||
"search-result-placeholder": "Type to start searching",
|
"search.result.placeholder": "Type to start searching",
|
||||||
"search-result-none": "No matching documents",
|
"search.result.none": "No matching documents",
|
||||||
"search-result-one": "1 matching document",
|
"search.result.one": "1 matching document",
|
||||||
"search-result-other": "# matching documents",
|
"search.result.other": "# matching documents",
|
||||||
"search-tokenizer": "[\s\-]+",
|
"search.tokenizer": "[\s\-]+",
|
||||||
"source-link-title": "Go to repository",
|
"source.link.title": "Go to repository",
|
||||||
"toc-title": "Table of contents"
|
"toc.title": "Table of contents"
|
||||||
}[key] }}{% endmacro %}
|
}[key] }}{% endmacro %}
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
<div class="md-search__inner">
|
<div class="md-search__inner">
|
||||||
<form class="md-search__form" name="search">
|
<form class="md-search__form" name="search">
|
||||||
<input type="text" class="md-search__input" name="query"
|
<input type="text" class="md-search__input" name="query"
|
||||||
required placeholder="{{ lang.t('search-placeholder') }}"
|
required placeholder="{{ lang.t('search.placeholder') }}"
|
||||||
autocapitalize="off" autocorrect="off" autocomplete="off"
|
autocapitalize="off" autocorrect="off" autocomplete="off"
|
||||||
spellcheck="false" data-md-component="query" />
|
spellcheck="false" data-md-component="query" />
|
||||||
<label class="md-icon md-search__icon" for="search"></label>
|
<label class="md-icon md-search__icon" for="search"></label>
|
||||||
@ -39,7 +39,7 @@
|
|||||||
<div class="md-search__scrollwrap" data-md-scrollfix>
|
<div class="md-search__scrollwrap" data-md-scrollfix>
|
||||||
<div class="md-search-result" data-md-component="result">
|
<div class="md-search-result" data-md-component="result">
|
||||||
<div class="md-search-result__meta">
|
<div class="md-search-result__meta">
|
||||||
{{ lang.t("search-result-placeholder") }}
|
{{ lang.t("search.result.placeholder") }}
|
||||||
</div>
|
</div>
|
||||||
<ol class="md-search-result__list"></ol>
|
<ol class="md-search-result__list"></ol>
|
||||||
</div>
|
</div>
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
<!-- Repository containing source -->
|
<!-- Repository containing source -->
|
||||||
{% block repo %}
|
{% block repo %}
|
||||||
<a href="{{ config.repo_url }}" title="{{ lang.t('source-link-title') }}"
|
<a href="{{ config.repo_url }}" title="{{ lang.t('source.link.title') }}"
|
||||||
class="md-source" data-md-source="{{ repo_type }}">
|
class="md-source" data-md-source="{{ repo_type }}">
|
||||||
{% if repo_type %}
|
{% if repo_type %}
|
||||||
<div class="md-source__icon">
|
<div class="md-source__icon">
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
<!-- Render item list -->
|
<!-- Render item list -->
|
||||||
{% if toc_ | first is defined %}
|
{% if toc_ | first is defined %}
|
||||||
<label class="md-nav__title" for="toc">{{ lang.t("toc-title") }}</label>
|
<label class="md-nav__title" for="toc">{{ lang.t("toc.title") }}</label>
|
||||||
<ul class="md-nav__list" data-md-scrollfix>
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
{% for toc_item in toc_ %}
|
{% for toc_item in toc_ %}
|
||||||
{% include "partials/toc-item.html" %}
|
{% include "partials/toc-item.html" %}
|
||||||
@ -47,9 +47,9 @@
|
|||||||
<!-- Source files -->
|
<!-- Source files -->
|
||||||
{% if page.meta.source and page.meta.source | length > 0 %}
|
{% if page.meta.source and page.meta.source | length > 0 %}
|
||||||
<li class="md-nav__item">
|
<li class="md-nav__item">
|
||||||
<a href="#__source" title="{{ lang.t('meta-source') }}"
|
<a href="#__source" title="{{ lang.t('meta.source') }}"
|
||||||
class="md-nav__link md-nav__link--active">
|
class="md-nav__link md-nav__link--active">
|
||||||
{{ lang.t("meta-source") }}
|
{{ lang.t("meta.source") }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -57,9 +57,9 @@
|
|||||||
<!-- Disqus integration -->
|
<!-- Disqus integration -->
|
||||||
{% if config.extra.disqus and not page.is_homepage %}
|
{% if config.extra.disqus and not page.is_homepage %}
|
||||||
<li class="md-nav__item">
|
<li class="md-nav__item">
|
||||||
<a href="#__comments" title="{{ lang.t('meta-comments') }}"
|
<a href="#__comments" title="{{ lang.t('meta.comments') }}"
|
||||||
class="md-nav__link md-nav__link--active">
|
class="md-nav__link md-nav__link--active">
|
||||||
{{ lang.t("meta-comments") }}
|
{{ lang.t("meta.comments") }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
Loading…
Reference in New Issue
Block a user