Skip to content
Snippets Groups Projects
Commit dee5844f authored by malthefogsporring's avatar malthefogsporring
Browse files

Update custom mkdocs-material file overrides to make the online docs...

Update custom mkdocs-material file overrides to make the online docs compatible with the current version of mkdocs-material.
parent 9579e606
No related branches found
No related tags found
No related merge requests found
......@@ -53,7 +53,7 @@ You can also edit the theme directly. Any file in the `site_overrides` folder wi
Before adding major style changes to the online docs, you are encouraged to test your changes locally. For this, you will need to install MkDocs and all the required extensions.
1. [Install MkDocs](https://www.mkdocs.org/), including its requirements.
2. Install Bootstrap with `pip install mkdocs-bootstrap`
2. Install Material with `pip install mkdocs-material`
3. Install the markdown extension with `pip install https://github.com/mitya57/python-markdown-math/archive/master.zip`
4. Install the exclude plugin with `pip install mkdocs-exclude`
5. Install the redirect plugin with `pip install mkdocs-redirects`
......
......@@ -15,35 +15,28 @@
<!--Override basic header-->
{% block header %}
<header class="md-header" data-md-component="header">
<nav class="md-header-nav md-grid" aria-label="{{ lang.t('header.title') }}">
<a href="{{ config.site_url | default(nav.homepage.url, true) | url }}" title="{{ config.site_name }}"
class="md-header-nav__button md-logo" style="width:1.7rem;" aria-label="{{ config.site_name }}">
<nav class="md-header__inner md-grid" aria-label="{{ lang.t('header.title') }}">
<a href="{{ config.extra.homepage | d(nav.homepage.url, true) | url }}" title="{{ config.site_name | e }}"
class="md-header__button md-logo" aria-label="{{ config.site_name }}" data-md-component="logo">
{% include "partials/logo.html" %}
</a>
<label class="md-header-nav__button md-icon" for="__drawer">
<label class="md-header__button md-icon" for="__drawer">
{% include ".icons/material/menu" ~ ".svg" %}
</label>
<!--Make site title permament-->
<div class="md-header-nav__title" data-md-component="header-title">
<div class="md-header-nav__ellipsis md-ellipsis">
<div class="md-header__title" data-md-component="header-title">
<div class="md-header__ellipsis md-header__topic md-ellipsis">
{{ config.site_name }}
</div>
</div>
{% if "search" in config["plugins"] %}
<label class="md-header-nav__button md-icon" for="__search">
<label class="md-header__button md-icon" for="__search">
{% include ".icons/material/magnify.svg" %}
</label>
{% include "partials/search.html" %}
{% endif %}
{% if config.repo_url %}
<div class="md-header-nav__source">
{% include "partials/source.html" %}
</div>
{% endif %}
</nav>
</header>
{% endblock %}
<!--Override basic footer-->
......
{#-
This file was automatically generated - do not edit
-#}
{% macro render(nav_item, path, level) %}
{% set class = "md-nav__item" %}
{% if nav_item.active %}
{% set class = "md-nav__item md-nav__item--active" %}
{% set class = class ~ " md-nav__item--active" %}
{% endif %}
<!--Skip first level in the navigation bar, i.e. the "En" level-->
......@@ -16,31 +14,30 @@
{% endfor %}
<!--Keep the rest the same-->
{% elif nav_item.children %}
{% if "navigation.sections" in features and level == 1 + (
"navigation.tabs" in features
) %}
{% set class = class ~ " md-nav__item--section" %}
{% endif %}
<li class="{{ class }} md-nav__item--nested">
{% if nav_item.active %}
<input class="md-nav__toggle md-toggle" data-md-toggle="{{ path }}" type="checkbox" id="{{ path }}" checked>
{% set checked = "checked" if nav_item.active %}
{% if "navigation.expand" in features and not checked %}
<input class="md-nav__toggle md-toggle" data-md-toggle="{{ path }}" data-md-state="indeterminate" type="checkbox" id="{{ path }}" checked>
{% else %}
<input class="md-nav__toggle md-toggle" data-md-toggle="{{ path }}" type="checkbox" id="{{ path }}">
<input class="md-nav__toggle md-toggle" data-md-toggle="{{ path }}" type="checkbox" id="{{ path }}" {{ checked }}>
{% endif %}
<label class="md-nav__link" for="{{ path }}">
{{ nav_item.title }}
<span class="md-nav__icon md-icon">
{% include ".icons/material/chevron-right.svg" %}
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="{{ nav_item.title }}" data-md-level="{{ level }}">
<label class="md-nav__title" for="{{ path }}">
<span class="md-nav__icon md-icon">
{% include ".icons/material/arrow-left.svg" %}
</span>
<span class="md-nav__icon md-icon"></span>
{{ nav_item.title }}
</label>
<ul class="md-nav__list" data-md-scrollfix>
{% set base = path %}
{% for nav_item in nav_item.children %}
{% set path = base + "-" + loop.index | string %}
{% set level = level + 1 %}
{% include "partials/nav-item.html" %}
{{ render(nav_item, path ~ "_" ~ loop.index, level + 1) }}
{% endfor %}
</ul>
</nav>
......@@ -49,28 +46,29 @@
<li class="{{ class }}">
{% set toc = page.toc %}
<input class="md-nav__toggle md-toggle" data-md-toggle="toc" type="checkbox" id="__toc">
{% if toc | first is defined and "\x3ch1 id=" in page.content %}
{% set toc = (toc | first).children %}
{% set first = toc | first %}
{% if first and first.level == 1 %}
{% set toc = first.children %}
{% endif %}
{% if toc | first is defined %}
{% if toc %}
<label class="md-nav__link md-nav__link--active" for="__toc">
{{ nav_item.title }}
<span class="md-nav__icon md-icon">
{% include ".icons/material/table-of-contents.svg" %}
</span>
<span class="md-nav__icon md-icon"></span>
</label>
{% endif %}
<a href="{{ nav_item.url | url }}" title="{{ nav_item.title | striptags }}" class="md-nav__link md-nav__link--active">
<a href="{{ nav_item.url | url }}" class="md-nav__link md-nav__link--active">
{{ nav_item.title }}
</a>
{% if toc | first is defined %}
{% if toc %}
{% include "partials/toc.html" %}
{% endif %}
</li>
{% else %}
<li class="{{ class }}">
<a href="{{ nav_item.url | url }}" title="{{ nav_item.title | striptags }}" class="md-nav__link">
<a href="{{ nav_item.url | url }}" class="md-nav__link">
{{ nav_item.title }}
</a>
</li>
{% endif %}
{% endmacro %}
{{ render(nav_item, path, level) }}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment