Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: vaimalaviya1233/mkdocs-material
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: squidfunk/mkdocs-material
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 6 commits
  • 42 files changed
  • 1 contributor

Commits on Mar 26, 2025

  1. Documentation

    squidfunk committed Mar 26, 2025

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    squidfunk Martin Donath
    Copy the full SHA
    e66107e View commit details

Commits on Mar 30, 2025

  1. Copy the full SHA
    ec38e30 View commit details
  2. Copy the full SHA
    fb0c27c View commit details
  3. Copy the full SHA
    c18630f View commit details
  4. Updated dependencies

    squidfunk committed Mar 30, 2025

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    squidfunk Martin Donath
    Copy the full SHA
    dc7d75e View commit details
  5. Prepare 9.6.10 release

    squidfunk committed Mar 30, 2025

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    squidfunk Martin Donath
    Copy the full SHA
    7bd6b92 View commit details
Showing with 782 additions and 686 deletions.
  1. +19 −0 CHANGELOG
  2. +21 −0 docs/changelog/index.md
  3. +6 −0 docs/plugins/tags.md
  4. +10 −0 docs/schema/assets/icons.json
  5. +1 −1 material/__init__.py
  6. +1 −1 material/overrides/assets/javascripts/iconsearch_index.json
  7. +1 −1 material/templates/.icons/octicons/id-badge-24.svg
  8. +1 −1 material/templates/.icons/octicons/mark-github-24.svg
  9. +1 −1 material/templates/.icons/simple/duckduckgo.svg
  10. +1 −1 material/templates/.icons/simple/easyeda.svg
  11. +1 −0 material/templates/.icons/simple/fortnite.svg
  12. +1 −0 material/templates/.icons/simple/gandi.svg
  13. +1 −0 material/templates/.icons/simple/gleam.svg
  14. +1 −0 material/templates/.icons/simple/h2database.svg
  15. +1 −0 material/templates/.icons/simple/kubespray.svg
  16. +1 −1 material/templates/.icons/simple/messenger.svg
  17. +1 −0 material/templates/.icons/simple/osmand.svg
  18. +1 −0 material/templates/.icons/simple/portableappsdotcom.svg
  19. +1 −1 material/templates/.icons/simple/trakt.svg
  20. +1 −0 material/templates/.icons/simple/umbrel.svg
  21. +1 −1 material/templates/.icons/simple/vercel.svg
  22. +1 −0 material/templates/.icons/simple/vinted.svg
  23. +1 −0 material/templates/.icons/simple/zenbrowser.svg
  24. +1 −1 material/templates/.icons/simple/zsh.svg
  25. +27 −31 material/templates/base.html
  26. +31 −26 material/templates/partials/consent.html
  27. +6 −1 material/templates/partials/feedback.html
  28. +17 −17 material/templates/partials/icons.html
  29. +15 −13 material/templates/partials/nav-item.html
  30. +2 −2 material/templates/partials/social.html
  31. +2 −2 material/templates/partials/source-file.html
  32. +4 −2 material/templates/partials/tabs-item.html
  33. +471 −471 package-lock.json
  34. +13 −13 package.json
  35. +28 −34 src/templates/base.html
  36. +44 −27 src/templates/partials/consent.html
  37. +6 −1 src/templates/partials/feedback.html
  38. +17 −17 src/templates/partials/icons.html
  39. +15 −13 src/templates/partials/nav-item.html
  40. +2 −2 src/templates/partials/social.html
  41. +2 −2 src/templates/partials/source-file.html
  42. +4 −2 src/templates/partials/tabs-item.html
19 changes: 19 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
mkdocs-material-9.6.10 (2025-03-30)

This version is a pure refactoring release, and does not contain new features
or bug fixes. It strives to improve the compatibility of our templates with
alternative Jinja-like template engines that we're currently exploring,
including minijinja.

Additionally, it replaces several instances of Python function invocations
with idiomatic use of template filters. All instances where variables have
been mutated inside templates have been replaced. Most changes have been made
in partials, and only a few in blocks, and all of them are fully backward
compatible, so no changes to overrides are necessary.

Note that this release does not replace the Jinja template engine with
minijinja. However, our templates are now 99% compatible with minijinja,
which means we can explore alternative Jinja-compatible implementations.
Additionally, immutability and removal of almost all Python function
invocations means much more idiomatic templating.

mkdocs-material-9.6.9 (2025-03-17)

* Updated Serbo-Croatian translations
21 changes: 21 additions & 0 deletions docs/changelog/index.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,27 @@

## Material for MkDocs

### 9.6.10 <small>March 30, 2025</small> { id="9.6.10" }

This version is a pure refactoring release, and does not contain new features
or bug fixes. It strives to improve the compatibility of our templates with
alternative Jinja-like template engines that we're currently exploring,
including [minijinja].

Additionally, it replaces several instances of Python function invocations
with idiomatic use of template filters. All instances where variables have
been mutated inside templates have been replaced. Most changes have been made
in partials, and only a few in blocks, and all of them are fully backward
compatible, so no changes to overrides are necessary.

Note that this release does not replace the Jinja template engine with
minijinja. However, our templates are now 99% compatible with minijinja,
which means we can explore alternative Jinja-compatible implementations.
Additionally, immutability and removal of almost all Python function
invocations means much more idiomatic templating.

[minijinja]: https://github.com/mitsuhiko/minijinja

### 9.6.9 <small>March 17, 2025</small> { id="9.6.9" }

- Updated Serbo-Croatian translations
6 changes: 6 additions & 0 deletions docs/plugins/tags.md
Original file line number Diff line number Diff line change
@@ -933,3 +933,9 @@ listing entirely:
```

If this setting is left empty, no tags or pages are excluded.

## Limitations

The implementation of the tags plugin is tricky due to MkDocs architecture.
Notably, tag listing markers cannot appear within code blocks. For technical
details, refer to #8114.
10 changes: 10 additions & 0 deletions docs/schema/assets/icons.json
Original file line number Diff line number Diff line change
@@ -11174,6 +11174,7 @@
"simple/formspree",
"simple/formstack",
"simple/fortinet",
"simple/fortnite",
"simple/fortran",
"simple/fossa",
"simple/fossilscm",
@@ -11222,6 +11223,7 @@
"simple/gameloft",
"simple/gamemaker",
"simple/gamescience",
"simple/gandi",
"simple/garmin",
"simple/gatling",
"simple/gatsby",
@@ -11262,6 +11264,7 @@
"simple/gitter",
"simple/glassdoor",
"simple/gldotinet",
"simple/gleam",
"simple/glide",
"simple/glitch",
"simple/globus",
@@ -11383,6 +11386,7 @@
"simple/gurobi",
"simple/gusto",
"simple/gutenberg",
"simple/h2database",
"simple/h3",
"simple/habr",
"simple/hackaday",
@@ -11706,6 +11710,7 @@
"simple/ktor",
"simple/kuaishou",
"simple/kubernetes",
"simple/kubespray",
"simple/kubuntu",
"simple/kucoin",
"simple/kueski",
@@ -12204,6 +12209,7 @@
"simple/osf",
"simple/osgeo",
"simple/oshkosh",
"simple/osmand",
"simple/osmc",
"simple/osu",
"simple/otto",
@@ -12360,6 +12366,7 @@
"simple/popos",
"simple/porkbun",
"simple/porsche",
"simple/portableappsdotcom",
"simple/portainer",
"simple/portswigger",
"simple/posit",
@@ -13140,6 +13147,7 @@
"simple/ulule",
"simple/umami",
"simple/umbraco",
"simple/umbrel",
"simple/uml",
"simple/unacademy",
"simple/underarmour",
@@ -13214,6 +13222,7 @@
"simple/vim",
"simple/vimeo",
"simple/vimeolivestream",
"simple/vinted",
"simple/virgin",
"simple/virginatlantic",
"simple/virginmedia",
@@ -13405,6 +13414,7 @@
"simple/zebratechnologies",
"simple/zedindustries",
"simple/zelle",
"simple/zenbrowser",
"simple/zend",
"simple/zendesk",
"simple/zenn",
2 changes: 1 addition & 1 deletion material/__init__.py
Original file line number Diff line number Diff line change
@@ -18,4 +18,4 @@
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.

__version__ = "9.6.9"
__version__ = "9.6.10"

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion material/templates/.icons/octicons/id-badge-24.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion material/templates/.icons/octicons/mark-github-24.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion material/templates/.icons/simple/duckduckgo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion material/templates/.icons/simple/easyeda.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions material/templates/.icons/simple/fortnite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions material/templates/.icons/simple/gandi.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions material/templates/.icons/simple/gleam.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions material/templates/.icons/simple/h2database.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions material/templates/.icons/simple/kubespray.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion material/templates/.icons/simple/messenger.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions material/templates/.icons/simple/osmand.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions material/templates/.icons/simple/portableappsdotcom.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion material/templates/.icons/simple/trakt.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions material/templates/.icons/simple/umbrel.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion material/templates/.icons/simple/vercel.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions material/templates/.icons/simple/vinted.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions material/templates/.icons/simple/zenbrowser.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion material/templates/.icons/simple/zsh.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
58 changes: 27 additions & 31 deletions material/templates/base.html
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@
<link rel="alternate" type="application/rss+xml" title="{{ lang.t('rss.updated') }}" href="{{ 'feed_rss_updated.xml' | url }}">
{% endif %}
<link rel="icon" href="{{ config.theme.favicon | url }}">
<meta name="generator" content="mkdocs-{{ mkdocs_version }}, mkdocs-material-9.6.9">
<meta name="generator" content="mkdocs-{{ mkdocs_version }}, mkdocs-material-9.6.10">
{% endblock %}
{% block htmltitle %}
{% if page.meta and page.meta.title %}
@@ -58,8 +58,8 @@
{% endblock %}
{% block fonts %}
{% if config.theme.font != false %}
{% set text = config.theme.font.get("text", "Roboto") %}
{% set code = config.theme.font.get("code", "Roboto Mono") %}
{% set text = config.theme.font.text | d("Roboto", true) %}
{% set code = config.theme.font.code | d("Roboto Mono", true) %}
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family={{
text | replace(' ', '+') + ':300,300i,400,400i,700,700i%7C' +
@@ -77,7 +77,7 @@
{% endblock %}
{% if page.meta and page.meta.meta %}
{% for tag in page.meta.meta %}
<meta {% for key, value in tag.items() %} {{ key }}="{{value}}" {% endfor %}>
<meta {% for key, value in tag | items %} {{ key }}="{{value}}" {% endfor %}>
{% endfor %}
{% endif %}
{% block extrahead %}{% endblock %}
@@ -214,38 +214,34 @@
{% include "partials/javascripts/consent.html" %}
{% endif %}
{% block config %}
{%- set app = {
"base": base_url,
"features": features,
"translations": {},
"search": "assets/javascripts/workers/search.f8cc74c7.min.js" | url
} -%}
{% set _ = namespace() %}
{% set _.tags = config.extra.tags %}
{%- if config.extra.version -%}
{%- set mike = config.plugins.get("mike") -%}
{%- set mike = config.plugins.mike -%}
{%- if not mike or mike.config.version_selector -%}
{%- set _ = app.update({ "version": config.extra.version }) -%}
{%- set _.version = config.extra.version -%}
{%- endif -%}
{%- endif -%}
{%- if config.extra.tags -%}
{%- set _ = app.update({ "tags": config.extra.tags }) -%}
{%- endif -%}
{%- set translations = app.translations -%}
{%- for key in [
"clipboard.copy",
"clipboard.copied",
"search.result.placeholder",
"search.result.none",
"search.result.one",
"search.result.other",
"search.result.more.one",
"search.result.more.other",
"search.result.term.missing",
"select.version"
] -%}
{%- set _ = translations.update({ key: lang.t(key) }) -%}
{%- endfor -%}
<script id="__config" type="application/json">
{{- app | tojson -}}
{{- {
"base": base_url,
"features": features,
"translations": {
"clipboard.copy": lang.t("clipboard.copy"),
"clipboard.copied": lang.t("clipboard.copied"),
"search.result.placeholder": lang.t("search.result.placeholder"),
"search.result.none": lang.t("search.result.none"),
"search.result.one": lang.t("search.result.one"),
"search.result.other": lang.t("search.result.other"),
"search.result.more.one": lang.t("search.result.more.one"),
"search.result.more.other": lang.t("search.result.more.other"),
"search.result.term.missing": lang.t("search.result.term.missing"),
"select.version": lang.t("select.version")
},
"search": "assets/javascripts/workers/search.f8cc74c7.min.js" | url,
"tags": _.tags or none,
"version": _.version or none
} | tojson -}}
</script>
{% endblock %}
{% block scripts %}
57 changes: 31 additions & 26 deletions material/templates/partials/consent.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
{#-
This file was automatically generated - do not edit
-#}
{% set cookies = config.extra.consent.cookies | d({}) %}
{% if config.extra.analytics %}
{% if "analytics" not in cookies %}
{% set _ = cookies.update({ "analytics": "Google Analytics" }) %}
{% endif %}
{% endif %}
{% if config.repo_url and "github.com" in config.repo_url %}
{% if "github" not in cookies %}
{% set _ = cookies.update({ "github": "GitHub" }) %}
{% macro render_cookie(cookie, type) %}
{% set checked = "" %}
{% if cookie is string %}
{% set name = cookie %}
{% set checked = "checked" %}
{% else %}
{% set name = cookie.name %}
{% if cookie.checked %}
{% set checked = "checked" %}
{% endif %}
{% endif %}
{% endif %}
<li class="task-list-item">
<label class="task-list-control">
<input type="checkbox" name="{{ type }}" {{ checked }}>
<span class="task-list-indicator"></span>
{{ name }}
</label>
</li>
{% endmacro %}
{% set actions = config.extra.consent.actions %}
{% if not actions %}
{% set actions = ["accept", "manage"] %}
@@ -24,24 +32,21 @@ <h4>{{ config.extra.consent.title }}</h4>
<input class="md-toggle" type="checkbox" id="__settings" {{ checked }}>
<div class="md-consent__settings">
<ul class="task-list">
{% set cookies = config.extra.consent.cookies %}
{% if "analytics" not in cookies %}
{% if config.extra.analytics %}
{{ render_cookie("Google Analytics", "analytics") }}
{% endif %}
{% endif %}
{% if "github" not in cookies %}
{% if config.repo_url and "github.com" in config.repo_url %}
{{ render_cookie("GitHub", "github") }}
{% endif %}
{% endif %}
{% for type in cookies %}
{% set checked = "" %}
{% if cookies[type] is string %}
{% set name = cookies[type] %}
{% set checked = "checked" %}
{% else %}
{% set name = cookies[type].name %}
{% if cookies[type].checked %}
{% set checked = "checked" %}
{% endif %}
{% if cookies[type] %}
{{ render_cookie(cookies[type], type) }}
{% endif %}
<li class="task-list-item">
<label class="task-list-control">
<input type="checkbox" name="{{ type }}" {{ checked }}>
<span class="task-list-indicator"></span>
{{ name }}
</label>
</li>
{% endfor %}
</ul>
</div>
7 changes: 6 additions & 1 deletion material/templates/partials/feedback.html
Original file line number Diff line number Diff line change
@@ -32,7 +32,12 @@
{% else %}
{% set title = page.title | urlencode %}
{% endif %}
{{ rating.note.format(url = url, title = title) }}
{% set note = rating.note %}
{% if note %}
{% set note = note | replace("{url}", url) %}
{% set note = note | replace("{title}", title) %}
{% endif %}
{{ note }}
</div>
{% endfor %}
</div>
34 changes: 17 additions & 17 deletions material/templates/partials/icons.html
Original file line number Diff line number Diff line change
@@ -2,47 +2,47 @@
This file was automatically generated - do not edit
-#}
{% if config.theme.icon.admonition %}
{% set style = ["\x3cstyle\x3e:root{"] %}
{% for type, icon in config.theme.icon.admonition.items() %}
{% set _ = namespace(style = "\x3cstyle\x3e:root{") %}
{% for type, icon in config.theme.icon.admonition | items %}
{% import ".icons/" ~ icon ~ ".svg" as icon %}
{% set _ = style.append(
{% set _.style = _.style ~
"--md-admonition-icon--" ~ type ~ ":" ~
"url('data:image/svg+xml;charset=utf-8," ~
icon | replace("\n", "") | urlencode ~
"');"
) %}
%}
{% endfor %}
{% set _ = style.append("}\x3c/style\x3e") %}
{{ style | join }}
{% set _.style = _.style ~ "}\x3c/style\x3e" %}
{{ _.style }}
{% endif %}
{% if config.theme.icon.annotation %}
{% set style = ["\x3cstyle\x3e:root{"] %}
{% set _ = namespace(style = "\x3cstyle\x3e:root{") %}
{% import ".icons/" ~ config.theme.icon.annotation ~ ".svg" as icon %}
{% set _ = style.append(
{% set _.style = _.style ~
"--md-annotation-icon:" ~
"url('data:image/svg+xml;charset=utf-8," ~
icon | replace("\n", "") | urlencode ~
"');"
) %}
{% set _ = style.append("}\x3c/style\x3e") %}
{{ style | join }}
%}
{% set _.style = _.style ~ "}\x3c/style\x3e" %}
{{ _.style }}
{% endif %}
{% if config.theme.icon.tag %}
{% set style = ["\x3cstyle\x3e"] %}
{% for type, icon in config.theme.icon.tag.items() %}
{% set _ = namespace(style = "\x3cstyle\x3e:root{") %}
{% for type, icon in config.theme.icon.tag | items %}
{% import ".icons/" ~ icon ~ ".svg" as icon %}
{% if type != "default" %}
{% set modifier = ".md-tag--" ~ type %}
{% endif %}
{% set _ = style.append(
{% set _.style = _.style ~
".md-tag" ~ modifier ~ "{" ~
"--md-tag-icon:" ~
"url('data:image/svg+xml;charset=utf-8," ~
icon | replace("\n", "") | urlencode ~
"');" ~
"}"
) %}
%}
{% endfor %}
{% set _ = style.append("\x3c/style\x3e") %}
{{ style | join }}
{% set _.style = _.style ~ "}\x3c/style\x3e" %}
{{ _.style }}
{% endif %}
28 changes: 15 additions & 13 deletions material/templates/partials/nav-item.html
Original file line number Diff line number Diff line change
@@ -10,7 +10,8 @@
<span class="{{ class }}"></span>
{% endif %}
{% endmacro %}
{% macro render_content(nav_item, ref = nav_item) %}
{% macro render_content(nav_item, ref) %}
{% set ref = ref or nav_item %}
{% if nav_item.meta and nav_item.meta.icon %}
{% include ".icons/" ~ nav_item.meta.icon ~ ".svg" %}
{% endif %}
@@ -25,7 +26,8 @@
{{ render_status(nav_item, nav_item.meta.status) }}
{% endif %}
{% endmacro %}
{% macro render_pruned(nav_item, ref = nav_item) %}
{% macro render_pruned(nav_item, ref) %}
{% set ref = ref or nav_item %}
{% set first = nav_item.children | first %}
{% if first and first.children %}
{{ render_pruned(first, ref) }}
@@ -38,7 +40,7 @@
</a>
{% endif %}
{% endmacro %}
{% macro render(nav_item, path, level) %}
{% macro render(nav_item, path, level, parent) %}
{% set class = "md-nav__item" %}
{% if nav_item.active %}
{% set class = class ~ " md-nav__item--active" %}
@@ -49,21 +51,22 @@
{% endif %}
{% endif %}
{% if nav_item.children %}
{% set indexes = [] %}
{% set _ = namespace(index = none) %}
{% if "navigation.indexes" in features %}
{% for nav_item in nav_item.children %}
{% if nav_item.is_index and not index is defined %}
{% set _ = indexes.append(nav_item) %}
{% for item in nav_item.children %}
{% if item.is_index and _.index is none %}
{% set _.index = item %}
{% endif %}
{% endfor %}
{% endif %}
{% set index = _.index %}
{% if "navigation.tabs" in features %}
{% if level == 1 and nav_item.active %}
{% set class = class ~ " md-nav__item--section" %}
{% set is_section = true %}
{% endif %}
{% if "navigation.sections" in features %}
{% if level == 2 and nav_item.parent.active %}
{% if level == 2 and parent.active %}
{% set class = class ~ " md-nav__item--section" %}
{% set is_section = true %}
{% endif %}
@@ -87,14 +90,13 @@
{% set indeterminate = "md-toggle--indeterminate" %}
{% endif %}
<input class="md-nav__toggle md-toggle {{ indeterminate }}" type="checkbox" id="{{ path }}" {{ checked }}>
{% if not indexes %}
{% if not index %}
{% set tabindex = "0" if not is_section %}
<label class="md-nav__link" for="{{ path }}" id="{{ path }}_label" tabindex="{{ tabindex }}">
{{ render_content(nav_item) }}
<span class="md-nav__icon md-icon"></span>
</label>
{% else %}
{% set index = indexes | first %}
{% set class = "md-nav__link--active" if index == page %}
<div class="md-nav__link md-nav__container">
<a href="{{ index.url | url }}" class="md-nav__link {{ class }}">
@@ -114,9 +116,9 @@
{{ nav_item.title }}
</label>
<ul class="md-nav__list" data-md-scrollfix>
{% for nav_item in nav_item.children %}
{% if not indexes or nav_item != indexes | first %}
{{ render(nav_item, path ~ "_" ~ loop.index, level + 1) }}
{% for item in nav_item.children %}
{% if not index or item != index %}
{{ render(item, path ~ "_" ~ loop.index, level + 1, nav_item) }}
{% endif %}
{% endfor %}
</ul>
4 changes: 2 additions & 2 deletions material/templates/partials/social.html
Original file line number Diff line number Diff line change
@@ -9,8 +9,8 @@
{% endif %}
{% set title = social.name %}
{% if not title and "//" in social.link %}
{% set _, url = social.link.split("//") %}
{% set title = url.split("/")[0] %}
{% set (_, url) = social.link.split("//") %}
{% set title = url.split("/") | first %}
{% endif %}
<a href="{{ social.link }}" target="_blank" rel="{{ rel }}" title="{{ title | e }}" class="md-social__link">
{% include ".icons/" ~ social.icon ~ ".svg" %}
4 changes: 2 additions & 2 deletions material/templates/partials/source-file.html
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@
</span>
{% endmacro %}
{% macro render_authors(authors) %}
{% set git_authors = config.plugins.get("git-authors") %}
{% set git_authors = config.plugins["git-authors"] %}
<span class="md-source-file__fact">
<span class="md-icon" title="{{ lang.t('source.file.contributors') }}">
{% if authors | length == 1 %}
@@ -101,7 +101,7 @@
{{ render_created(created) }}
{% endif %}
{% if git_info %}
{{ render_authors(git_info.get("page_authors")) }}
{{ render_authors(git_info["page_authors"]) }}
{% endif %}
{% if committers %}
{{ render_committers(committers) }}
6 changes: 4 additions & 2 deletions material/templates/partials/tabs-item.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
{#-
This file was automatically generated - do not edit
-#}
{% macro render_content(nav_item, ref = nav_item) %}
{% macro render_content(nav_item, ref) %}
{% set ref = ref or nav_item %}
{% if nav_item == ref or "navigation.indexes" in features %}
{% if nav_item.is_index and nav_item.meta.icon %}
{% include ".icons/" ~ nav_item.meta.icon ~ ".svg" %}
{% endif %}
{% endif %}
{{ ref.title }}
{% endmacro %}
{% macro render(nav_item, ref = nav_item) %}
{% macro render(nav_item, ref) %}
{% set ref = ref or nav_item %}
{% set class = "md-tabs__item" %}
{% if ref.active %}
{% set class = class ~ " md-tabs__item--active" %}
942 changes: 471 additions & 471 deletions package-lock.json

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mkdocs-material",
"version": "9.6.9",
"version": "9.6.10",
"description": "Documentation that simply works",
"keywords": [
"mkdocs",
@@ -53,7 +53,7 @@
"devDependencies": {
"@fortawesome/fontawesome-free": "^6.7.2",
"@mdi/svg": "^7.4.47",
"@primer/octicons": "^19.15.0",
"@primer/octicons": "^19.15.1",
"@stylistic/eslint-plugin-ts": "3.1.0",
"@stylistic/stylelint-config": "^2.0.0",
"@stylistic/stylelint-plugin": "^3.1.2",
@@ -62,27 +62,27 @@
"@types/fuzzaldrin-plus": "^0.6.5",
"@types/html-minifier-terser": "^7.0.2",
"@types/lunr": "^2.3.7",
"@types/node": "^22.13.7",
"@types/node": "^22.13.14",
"@types/resize-observer-browser": "^0.1.11",
"@types/sass": "^1.45.0",
"@typescript-eslint/eslint-plugin": "^8.25.0",
"@typescript-eslint/parser": "^8.25.0",
"autoprefixer": "^10.4.20",
"@typescript-eslint/eslint-plugin": "^8.28.0",
"@typescript-eslint/parser": "^8.28.0",
"autoprefixer": "^10.4.21",
"chokidar": "^4.0.3",
"cssnano": "5.1.0",
"esbuild": "^0.25.0",
"esbuild": "^0.25.1",
"eslint": "8.57.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jsdoc": "^50.6.3",
"eslint-plugin-jsdoc": "^50.6.9",
"eslint-plugin-no-null": "^1.0.2",
"github-types": "^1.0.0",
"gitlab": "^14.2.2",
"google-fonts-complete": "jonathantneal/google-fonts-complete",
"html-minifier-terser": "^7.2.0",
"material-design-color": "^2.3.2",
"material-shadows": "^3.0.1",
"npm-check-updates": "^17.1.15",
"npm-check-updates": "^17.1.16",
"npm-run-all": "^4.1.5",
"postcss": "^8.5.3",
"postcss-dir-pseudo-class": "^9.0.1",
@@ -91,17 +91,17 @@
"postcss-pseudo-is": "^0.3.0",
"preact": "^10.26.4",
"rimraf": "^6.0.1",
"sass": "^1.85.1",
"simple-icons": "^14.8.0",
"stylelint": "^16.15.0",
"sass": "^1.86.0",
"simple-icons": "^14.12.0",
"stylelint": "^16.17.0",
"stylelint-config-recess-order": "5.1.1",
"stylelint-config-recommended": "14.0.1",
"stylelint-config-standard-scss": "^14.0.0",
"stylelint-scss": "^6.11.1",
"svgo": "^3.3.2",
"tiny-glob": "^0.2.9",
"ts-node": "^10.9.2",
"typescript": "^5.7.3"
"typescript": "^5.8.2"
},
"engines": {
"node": ">= 18"
62 changes: 28 additions & 34 deletions src/templates/base.html
Original file line number Diff line number Diff line change
@@ -126,8 +126,8 @@

<!-- Load fonts from Google -->
{% if config.theme.font != false %}
{% set text = config.theme.font.get("text", "Roboto") %}
{% set code = config.theme.font.get("code", "Roboto Mono") %}
{% set text = config.theme.font.text | d("Roboto", true) %}
{% set code = config.theme.font.code | d("Roboto Mono", true) %}
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
rel="stylesheet"
@@ -162,7 +162,7 @@
{% if page.meta and page.meta.meta %}
{% for tag in page.meta.meta %}
<meta
{% for key, value in tag.items() %}
{% for key, value in tag | items %}
{{ key }}="{{value}}"
{% endfor %}
/>
@@ -387,46 +387,40 @@

<!-- Theme-related configuration -->
{% block config %}
{%- set app = {
"base": base_url,
"features": features,
"translations": {},
"search": "assets/javascripts/workers/search.js" | url
} -%}
{% set _ = namespace() %}

<!-- Extra configuration -->
{% set _.tags = config.extra.tags %}

<!-- Versioning -->
{%- if config.extra.version -%}
{%- set mike = config.plugins.get("mike") -%}
{%- set mike = config.plugins.mike -%}
{%- if not mike or mike.config.version_selector -%}
{%- set _ = app.update({ "version": config.extra.version }) -%}
{%- set _.version = config.extra.version -%}
{%- endif -%}
{%- endif -%}

<!-- Tags -->
{%- if config.extra.tags -%}
{%- set _ = app.update({ "tags": config.extra.tags }) -%}
{%- endif -%}

<!-- Translations -->
{%- set translations = app.translations -%}
{%- for key in [
"clipboard.copy",
"clipboard.copied",
"search.result.placeholder",
"search.result.none",
"search.result.one",
"search.result.other",
"search.result.more.one",
"search.result.more.other",
"search.result.term.missing",
"select.version"
] -%}
{%- set _ = translations.update({ key: lang.t(key) }) -%}
{%- endfor -%}

<!-- Configuration -->
<script id="__config" type="application/json">
{{- app | tojson -}}
{{- {
"base": base_url,
"features": features,
"translations": {
"clipboard.copy": lang.t("clipboard.copy"),
"clipboard.copied": lang.t("clipboard.copied"),
"search.result.placeholder": lang.t("search.result.placeholder"),
"search.result.none": lang.t("search.result.none"),
"search.result.one": lang.t("search.result.one"),
"search.result.other": lang.t("search.result.other"),
"search.result.more.one": lang.t("search.result.more.one"),
"search.result.more.other": lang.t("search.result.more.other"),
"search.result.term.missing": lang.t("search.result.term.missing"),
"select.version": lang.t("select.version")
},
"search": "assets/javascripts/workers/search.js" | url,
"tags": _.tags or none,
"version": _.version or none
} | tojson -}}
</script>
{% endblock %}

71 changes: 44 additions & 27 deletions src/templates/partials/consent.html
Original file line number Diff line number Diff line change
@@ -20,18 +20,32 @@
IN THE SOFTWARE.
-->

<!-- Determine cookies -->
{% set cookies = config.extra.consent.cookies | d({}) %}
{% if config.extra.analytics %}
{% if "analytics" not in cookies %}
{% set _ = cookies.update({ "analytics": "Google Analytics" }) %}
{% endif %}
{% endif %}
{% if config.repo_url and "github.com" in config.repo_url %}
{% if "github" not in cookies %}
{% set _ = cookies.update({ "github": "GitHub" }) %}
<!-- Render cookie checkbox -->
{% macro render_cookie(cookie, type) %}
{% set checked = "" %}

<!-- Cookie with defaults -->
{% if cookie is string %}
{% set name = cookie %}
{% set checked = "checked" %}

<!-- Cookie with settings -->
{% else %}
{% set name = cookie.name %}
{% if cookie.checked %}
{% set checked = "checked" %}
{% endif %}
{% endif %}
{% endif %}
<li class="task-list-item">
<label class="task-list-control">
<input type="checkbox" name="{{ type }}" {{ checked }}>
<span class="task-list-indicator"></span>
{{ name }}
</label>
</li>
{% endmacro %}

<!-- ---------------------------------------------------------------------- -->

<!-- Determine actions -->
{% set actions = config.extra.consent.actions %}
@@ -57,24 +71,27 @@ <h4>{{ config.extra.consent.title }}</h4>
/>
<div class="md-consent__settings">
<ul class="task-list">
{% set cookies = config.extra.consent.cookies %}

<!-- Google Analytics cookie, it not set -->
{% if "analytics" not in cookies %}
{% if config.extra.analytics %}
{{ render_cookie("Google Analytics", "analytics") }}
{% endif %}
{% endif %}

<!-- GitHub cookie, if not set -->
{% if "github" not in cookies %}
{% if config.repo_url and "github.com" in config.repo_url %}
{{ render_cookie("GitHub", "github") }}
{% endif %}
{% endif %}

<!-- Configured cookies-->
{% for type in cookies %}
{% set checked = "" %}
{% if cookies[type] is string %}
{% set name = cookies[type] %}
{% set checked = "checked" %}
{% else %}
{% set name = cookies[type].name %}
{% if cookies[type].checked %}
{% set checked = "checked" %}
{% endif %}
{% if cookies[type] %}
{{ render_cookie(cookies[type], type) }}
{% endif %}
<li class="task-list-item">
<label class="task-list-control">
<input type="checkbox" name="{{ type }}" {{ checked }}>
<span class="task-list-indicator"></span>
{{ name }}
</label>
</li>
{% endfor %}
</ul>
</div>
7 changes: 6 additions & 1 deletion src/templates/partials/feedback.html
Original file line number Diff line number Diff line change
@@ -69,7 +69,12 @@
{% endif %}

<!-- Replace {url} and {title} placeholders in note -->
{{ rating.note.format(url = url, title = title) }}
{% set note = rating.note %}
{% if note %}
{% set note = note | replace("{url}", url) %}
{% set note = note | replace("{title}", title) %}
{% endif %}
{{ note }}
</div>
{% endfor %}
</div>
34 changes: 17 additions & 17 deletions src/templates/partials/icons.html
Original file line number Diff line number Diff line change
@@ -22,51 +22,51 @@

<!-- Custom admonition icons -->
{% if config.theme.icon.admonition %}
{% set style = ["\x3cstyle\x3e:root{"] %}
{% for type, icon in config.theme.icon.admonition.items() %}
{% set _ = namespace(style = "\x3cstyle\x3e:root{") %}
{% for type, icon in config.theme.icon.admonition | items %}
{% import ".icons/" ~ icon ~ ".svg" as icon %}
{% set _ = style.append(
{% set _.style = _.style ~
"--md-admonition-icon--" ~ type ~ ":" ~
"url('data:image/svg+xml;charset=utf-8," ~
icon | replace("\n", "") | urlencode ~
"');"
) %}
%}
{% endfor %}
{% set _ = style.append("}\x3c/style\x3e") %}
{{ style | join }}
{% set _.style = _.style ~ "}\x3c/style\x3e" %}
{{ _.style }}
{% endif %}

<!-- Custom annotation icon -->
{% if config.theme.icon.annotation %}
{% set style = ["\x3cstyle\x3e:root{"] %}
{% set _ = namespace(style = "\x3cstyle\x3e:root{") %}
{% import ".icons/" ~ config.theme.icon.annotation ~ ".svg" as icon %}
{% set _ = style.append(
{% set _.style = _.style ~
"--md-annotation-icon:" ~
"url('data:image/svg+xml;charset=utf-8," ~
icon | replace("\n", "") | urlencode ~
"');"
) %}
{% set _ = style.append("}\x3c/style\x3e") %}
{{ style | join }}
%}
{% set _.style = _.style ~ "}\x3c/style\x3e" %}
{{ _.style }}
{% endif %}

<!-- Custom tag icons -->
{% if config.theme.icon.tag %}
{% set style = ["\x3cstyle\x3e"] %}
{% for type, icon in config.theme.icon.tag.items() %}
{% set _ = namespace(style = "\x3cstyle\x3e:root{") %}
{% for type, icon in config.theme.icon.tag | items %}
{% import ".icons/" ~ icon ~ ".svg" as icon %}
{% if type != "default" %}
{% set modifier = ".md-tag--" ~ type %}
{% endif %}
{% set _ = style.append(
{% set _.style = _.style ~
".md-tag" ~ modifier ~ "{" ~
"--md-tag-icon:" ~
"url('data:image/svg+xml;charset=utf-8," ~
icon | replace("\n", "") | urlencode ~
"');" ~
"}"
) %}
%}
{% endfor %}
{% set _ = style.append("\x3c/style\x3e") %}
{{ style | join }}
{% set _.style = _.style ~ "}\x3c/style\x3e" %}
{{ _.style }}
{% endif %}
28 changes: 15 additions & 13 deletions src/templates/partials/nav-item.html
Original file line number Diff line number Diff line change
@@ -39,7 +39,8 @@
{% endmacro %}

<!-- Render navigation link content -->
{% macro render_content(nav_item, ref = nav_item) %}
{% macro render_content(nav_item, ref) %}
{% set ref = ref or nav_item %}

<!-- Navigation link icon -->
{% if nav_item.meta and nav_item.meta.icon %}
@@ -64,7 +65,8 @@
{% endmacro %}

<!-- Render navigation item (pruned) -->
{% macro render_pruned(nav_item, ref = nav_item) %}
{% macro render_pruned(nav_item, ref) %}
{% set ref = ref or nav_item %}
{% set first = nav_item.children | first %}

<!-- Recurse, if the first item has further nested items -->
@@ -85,7 +87,7 @@
{% endmacro %}

<!-- Render navigation item -->
{% macro render(nav_item, path, level) %}
{% macro render(nav_item, path, level, parent) %}

<!-- Determine classes -->
{% set class = "md-nav__item" %}
@@ -104,14 +106,15 @@
{% if nav_item.children %}

<!-- Determine all nested items that are index pages -->
{% set indexes = [] %}
{% set _ = namespace(index = none) %}
{% if "navigation.indexes" in features %}
{% for nav_item in nav_item.children %}
{% if nav_item.is_index and not index is defined %}
{% set _ = indexes.append(nav_item) %}
{% for item in nav_item.children %}
{% if item.is_index and _.index is none %}
{% set _.index = item %}
{% endif %}
{% endfor %}
{% endif %}
{% set index = _.index %}

<!-- Navigation tabs -->
{% if "navigation.tabs" in features %}
@@ -126,7 +129,7 @@
{% if "navigation.sections" in features %}

<!-- Render 2nd level items with nested items as sections -->
{% if level == 2 and nav_item.parent.active %}
{% if level == 2 and parent.active %}
{% set class = class ~ " md-nav__item--section" %}
{% set is_section = true %}
{% endif %}
@@ -171,7 +174,7 @@
/>

<!-- Toggle to expand nested items -->
{% if not indexes %}
{% if not index %}
{% set tabindex = "0" if not is_section %}
<label
class="md-nav__link"
@@ -185,7 +188,6 @@

<!-- Toggle to expand nested items with link to index page -->
{% else %}
{% set index = indexes | first %}
{% set class = "md-nav__link--active" if index == page %}
<div class="md-nav__link md-nav__container">
<a
@@ -224,9 +226,9 @@
<ul class="md-nav__list" data-md-scrollfix>

<!-- Nested navigation item -->
{% for nav_item in nav_item.children %}
{% if not indexes or nav_item != indexes | first %}
{{ render(nav_item, path ~ "_" ~ loop.index, level + 1) }}
{% for item in nav_item.children %}
{% if not index or item != index %}
{{ render(item, path ~ "_" ~ loop.index, level + 1, nav_item) }}
{% endif %}
{% endfor %}
</ul>
4 changes: 2 additions & 2 deletions src/templates/partials/social.html
Original file line number Diff line number Diff line change
@@ -33,8 +33,8 @@
<!-- Compute title and render link -->
{% set title = social.name %}
{% if not title and "//" in social.link %}
{% set _, url = social.link.split("//") %}
{% set title = url.split("/")[0] %}
{% set (_, url) = social.link.split("//") %}
{% set title = url.split("/") | first %}
{% endif %}
<a
href="{{ social.link }}"
4 changes: 2 additions & 2 deletions src/templates/partials/source-file.html
Original file line number Diff line number Diff line change
@@ -44,7 +44,7 @@

<!-- Render authors -->
{% macro render_authors(authors) %}
{% set git_authors = config.plugins.get("git-authors") %}
{% set git_authors = config.plugins["git-authors"] %}
<span class="md-source-file__fact">
<span class="md-icon" title="{{ lang.t('source.file.contributors') }}">
{% if authors | length == 1 %}
@@ -161,7 +161,7 @@

<!-- Authors (git-authors plugin) -->
{% if git_info %}
{{ render_authors(git_info.get("page_authors")) }}
{{ render_authors(git_info["page_authors"]) }}
{% endif %}

<!-- Authors (git-committers plugin) -->
6 changes: 4 additions & 2 deletions src/templates/partials/tabs-item.html
Original file line number Diff line number Diff line change
@@ -21,7 +21,8 @@
-->

<!-- Render navigation link content -->
{% macro render_content(nav_item, ref = nav_item) %}
{% macro render_content(nav_item, ref) %}
{% set ref = ref or nav_item %}

<!-- Navigation link icon -->
{% if nav_item == ref or "navigation.indexes" in features %}
@@ -35,7 +36,8 @@
{% endmacro %}

<!-- Render navigation item -->
{% macro render(nav_item, ref = nav_item) %}
{% macro render(nav_item, ref) %}
{% set ref = ref or nav_item %}

<!-- Determine classes -->
{% set class = "md-tabs__item" %}