1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-12-18 02:15:56 +01:00

Added support for different spellings for theme color

This commit is contained in:
squidfunk 2018-06-18 10:19:07 +02:00
parent 4d7f77e88b
commit 602de62ae3
2 changed files with 8 additions and 4 deletions

View File

@ -54,8 +54,10 @@
{% endif %} {% endif %}
{% if palette.primary %} {% if palette.primary %}
{% import "partials/palette.html" as map %} {% import "partials/palette.html" as map %}
{% set color = map.primary(palette.primary) %} {% set primary = map.primary(
<meta name="theme-color" content="{{ color }}"> palette.primary | replace(" ", "-") | lower
) %}
<meta name="theme-color" content="{{ primary }}">
{% endif %} {% endif %}
{% endblock %} {% endblock %}
{% block libs %} {% block libs %}

View File

@ -110,8 +110,10 @@
<!-- Theme-color meta tag for Android --> <!-- Theme-color meta tag for Android -->
{% if palette.primary %} {% if palette.primary %}
{% import "partials/palette.html" as map %} {% import "partials/palette.html" as map %}
{% set color = map.primary(palette.primary) %} {% set primary = map.primary(
<meta name="theme-color" content="{{ color }}" /> palette.primary | replace(" ", "-") | lower
) %}
<meta name="theme-color" content="{{ primary }}" />
{% endif %} {% endif %}
{% endblock %} {% endblock %}