1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2025-02-06 14:14:23 +01:00

Remove icon ligatures from HTML to fix search indexing

This commit is contained in:
squidfunk 2017-01-11 23:49:36 +01:00
parent b32084bf8b
commit 1a32e9b7e3
11 changed files with 42 additions and 36 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -37,7 +37,7 @@
{% include "partials/fonts.html" %} {% include "partials/fonts.html" %}
{% endblock %} {% endblock %}
{% block styles %} {% block styles %}
<link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application-0bf20c7a55.css"> <link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application-ff220fd69d.css">
{% if config.extra.palette %} {% if config.extra.palette %}
<link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application-02ce7adcc2.palette.css"> <link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application-02ce7adcc2.palette.css">
{% endif %} {% endif %}

View File

@ -6,7 +6,7 @@
{% if page.previous_page %} {% if page.previous_page %}
<a href="{{ page.previous_page.url }}" title="{{ page.previous_page.title }}" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev"> <a href="{{ page.previous_page.url }}" title="{{ page.previous_page.title }}" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<i class="md-icon md-footer-nav__icon">arrow_back</i> <i class="md-icon md-icon--arrow-back md-footer-nav__icon"></i>
</div> </div>
<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">
@ -29,7 +29,7 @@
</span> </span>
</div> </div>
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<i class="md-icon md-footer-nav__icon">arrow_forward</i> <i class="md-icon md-icon--arrow-forward md-footer-nav__icon"></i>
</div> </div>
</a> </a>
{% endif %} {% endif %}

View File

@ -2,18 +2,14 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="{{ nav.homepage.url }}" title="{{ config.site_name }}" class="md-icon md-header-nav__icon md-header-nav__icon--home"> <a href="{{ nav.homepage.url }}" title="{{ config.site_name }}" class="md-icon {% if not config.extra.logo %} md-icon--home {% endif %} md-header-nav__icon">
{% if config.extra.logo %} {% if config.extra.logo %}
<img src="{{ base_url }}/{{ config.extra.logo }}" width="24" height="24"> <img src="{{ base_url }}/{{ config.extra.logo }}" width="24" height="24">
{% else %}
school
{% endif %} {% endif %}
</a> </a>
</div> </div>
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<label class="md-icon md-header-nav__icon md-header-nav__icon--menu" for="drawer"> <label class="md-icon md-icon--menu md-header-nav__icon" for="drawer"></label>
menu
</label>
</div> </div>
<div class="md-flex__cell md-flex__cell--stretch"> <div class="md-flex__cell md-flex__cell--stretch">
<span class="md-flex__ellipsis md-header-nav__title"> <span class="md-flex__ellipsis md-header-nav__title">
@ -31,9 +27,7 @@
</div> </div>
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
{% block search_box %} {% block search_box %}
<label class="md-icon md-header-nav__icon md-header-nav__icon--search" for="search"> <label class="md-icon md-icon--search md-header-nav__icon" for="search"></label>
search
</label>
{% include "partials/search.html" %} {% include "partials/search.html" %}
{% endblock %} {% endblock %}
</div> </div>

View File

@ -1,10 +1,8 @@
<nav class="md-nav md-nav--primary"> <nav class="md-nav md-nav--primary">
<label class="md-nav__title md-nav__title--site" for="drawer"> <label class="md-nav__title md-nav__title--site" for="drawer">
<i class="md-icon md-nav__icon"> <i class="md-icon {% if not config.extra.logo %} md-icon--home {% endif %} md-nav__icon">
{% if config.extra.logo %} {% if config.extra.logo %}
<img src="{{ base_url }}/{{ config.extra.logo }}"> <img src="{{ base_url }}/{{ config.extra.logo }}">
{% else %}
school
{% endif %} {% endif %}
</i> </i>
{{ config.site_name }} {{ config.site_name }}

View File

@ -50,4 +50,17 @@
// Representational classes // Representational classes
.md-icon { .md-icon {
@extend %md-icon; @extend %md-icon;
// Build representational classes
@each $ligature, $name in (
"arrow_back": "arrow-back",
"arrow_forward": "arrow-forward",
"menu": "menu",
"search": "search",
"school": "home"
) {
&--#{$name}::before {
content: $ligature;
}
}
} }

View File

@ -62,7 +62,7 @@
} }
// Hide search icon, if JavaScript is not available. // Hide search icon, if JavaScript is not available.
.no-js &--search { .no-js & .md-icon--search {
display: none; display: none;
} }
@ -70,7 +70,7 @@
@include break-from-device(tablet landscape) { @include break-from-device(tablet landscape) {
// Search icon // Search icon
&--search { &.md-icon--search {
display: none; display: none;
} }
} }
@ -79,7 +79,7 @@
@include break-to-device(tablet) { @include break-to-device(tablet) {
// Home icon // Home icon
&--home { &.md-icon--home {
display: none; display: none;
} }
} }
@ -88,7 +88,7 @@
@include break-from-device(screen) { @include break-from-device(screen) {
// Menu icon // Menu icon
&--menu { &.md-icon--menu {
display: none; display: none;
} }
} }

View File

@ -37,7 +37,8 @@
class="md-flex md-footer-nav__link md-footer-nav__link--prev" class="md-flex md-footer-nav__link md-footer-nav__link--prev"
rel="prev"> rel="prev">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<i class="md-icon md-footer-nav__icon">arrow_back</i> <i class="md-icon md-icon--arrow-back
md-footer-nav__icon"></i>
</div> </div>
<div class="md-flex__cell md-flex__cell--stretch <div class="md-flex__cell md-flex__cell--stretch
md-footer-nav__title"> md-footer-nav__title">
@ -66,7 +67,8 @@
</span> </span>
</div> </div>
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<i class="md-icon md-footer-nav__icon">arrow_forward</i> <i class="md-icon md-icon--arrow-forward
md-footer-nav__icon"></i>
</div> </div>
</a> </a>
{% endif %} {% endif %}

View File

@ -30,22 +30,21 @@
<!-- Link to home --> <!-- Link to home -->
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="{{ nav.homepage.url }}" title="{{ config.site_name }}" <a href="{{ nav.homepage.url }}" title="{{ config.site_name }}"
class="md-icon md-header-nav__icon md-header-nav__icon--home"> class="md-icon
{% if not config.extra.logo %}
md-icon--home
{% endif %} md-header-nav__icon">
{% if config.extra.logo %} {% if config.extra.logo %}
<img src="{{ base_url }}/{{ config.extra.logo }}" <img src="{{ base_url }}/{{ config.extra.logo }}"
width="24" height="24" /> width="24" height="24" />
{% else %}
school
{% endif %} {% endif %}
</a> </a>
</div> </div>
<!-- Button to toggle drawer --> <!-- Button to toggle drawer -->
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<label class="md-icon md-header-nav__icon md-header-nav__icon--menu" <label class="md-icon md-icon--menu md-header-nav__icon"
for="drawer"> for="drawer"></label>
menu
</label>
</div> </div>
<!-- Header title --> <!-- Header title -->
@ -67,10 +66,8 @@
<!-- Button to open search dialogue --> <!-- Button to open search dialogue -->
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
{% block search_box %} {% block search_box %}
<label class="md-icon md-header-nav__icon <label class="md-icon md-icon--search md-header-nav__icon"
md-header-nav__icon--search" for="search"> for="search"></label>
search
</label>
<!-- Search interface --> <!-- Search interface -->
{% include "partials/search.html" %} {% include "partials/search.html" %}

View File

@ -23,11 +23,13 @@
<!-- Main navigation --> <!-- Main navigation -->
<nav class="md-nav md-nav--primary"> <nav class="md-nav md-nav--primary">
<label class="md-nav__title md-nav__title--site" for="drawer"> <label class="md-nav__title md-nav__title--site" for="drawer">
<i class="md-icon md-nav__icon"> <i class="md-icon
{% if not config.extra.logo %}
md-icon--home
{% endif %}
md-nav__icon">
{% if config.extra.logo %} {% if config.extra.logo %}
<img src="{{ base_url }}/{{ config.extra.logo }}" /> <img src="{{ base_url }}/{{ config.extra.logo }}" />
{% else %}
school
{% endif %} {% endif %}
</i> </i>
{{ config.site_name }} {{ config.site_name }}