Added preconnect for Google Fonts for faster loading

This commit is contained in:
squidfunk 2018-02-22 19:15:32 +01:00
parent de1c3d515e
commit 36ec35c2e4
3 changed files with 8 additions and 0 deletions

View File

@ -1,3 +1,7 @@
mkdocs-material-2.x.x (2018-xx-xx)
* Added preconnect for Google Fonts for faster loading
mkdocs-material-2.6.5 (2018-02-22) mkdocs-material-2.6.5 (2018-02-22)
* Reverted --dev-addr flag removal from Dockerfile * Reverted --dev-addr flag removal from Dockerfile

View File

@ -57,6 +57,7 @@
<script src="{{ base_url }}/assets/javascripts/modernizr.1aa3b519.js"></script> <script src="{{ base_url }}/assets/javascripts/modernizr.1aa3b519.js"></script>
{% endblock %} {% endblock %}
{% block fonts %} {% block fonts %}
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
{% if font != false %} {% if font != false %}
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family={{ <link rel="stylesheet" href="https://fonts.googleapis.com/css?family={{
font.text | replace(' ', '+') + ':300,400,400i,700|' + font.text | replace(' ', '+') + ':300,400,400i,700|' +

View File

@ -115,6 +115,9 @@
<!-- Webfonts --> <!-- Webfonts -->
{% block fonts %} {% block fonts %}
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin />
<!-- Load fonts from Google -->
{% if font != false %} {% if font != false %}
<link rel="stylesheet" type="text/css" <link rel="stylesheet" type="text/css"
href="https://fonts.googleapis.com/css?family={{ href="https://fonts.googleapis.com/css?family={{