Merge branch 'main' of https://gitea.exu.li/exu/wiki-grav
This commit is contained in:
commit
c87e1bc63f
@ -16,6 +16,5 @@ readme: https://example.com/README.md
|
|||||||
license: MIT
|
license: MIT
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
- { name: grav, version: '>=1.6.0' }
|
- { name: grav, version: ">=1.6.0" }
|
||||||
- langswitcher
|
|
||||||
- learn2
|
- learn2
|
||||||
|
@ -1,33 +0,0 @@
|
|||||||
<ul class="langswitcher">
|
|
||||||
{% set display_format = display_format ?? config.get('plugins.langswitcher.language_display', 'long') %}
|
|
||||||
|
|
||||||
{% for language in langswitcher.languages %}
|
|
||||||
{% set active_class = '' %}
|
|
||||||
{% set show_language = true %}
|
|
||||||
{% if language == langswitcher.current %}
|
|
||||||
{% set active_class = 'active' %}
|
|
||||||
{% endif %}
|
|
||||||
{% if langswitcher.translated_routes[language] %}
|
|
||||||
{% set lang_url = langswitcher.translated_routes[language] ~ page.urlExtension %}
|
|
||||||
{% else %}
|
|
||||||
{% set base_lang_url = base_url_simple ~ grav.language.getLanguageURLPrefix(language) %}
|
|
||||||
{% set lang_url = base_lang_url ~ langswitcher.page_route ~ page.urlExtension %}
|
|
||||||
{% endif %}
|
|
||||||
{% set untranslated_pages_behavior = grav.config.plugins.langswitcher.untranslated_pages_behavior %}
|
|
||||||
{% if untranslated_pages_behavior != 'none' %}
|
|
||||||
{% set translated_page = langswitcher.translated_pages[language] %}
|
|
||||||
{% if (not translated_page) or (not translated_page.published) %}
|
|
||||||
{% if untranslated_pages_behavior == 'redirect' %}
|
|
||||||
{% set lang_url = url('/') %}
|
|
||||||
{% elseif untranslated_pages_behavior == 'hide' %}
|
|
||||||
{% set show_language = false %}
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if show_language %}
|
|
||||||
<li><a href="{{ lang_url ~ uri.params ~ (uri.query|length > 1 ? '?' ~ uri.query) }}" class="external {{ active_class }}">{% include 'partials/langswitcher-' ~ display_format ~ '.html.twig' %}</a></li>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% endfor %}
|
|
||||||
</ul>
|
|
@ -6,5 +6,3 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
{# {% include 'partials/langswitcher.html.twig' %} #}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user