From 909591e0a8fa87c27db8989be3eaec15edf1d2b2 Mon Sep 17 00:00:00 2001 From: squidfunk Date: Thu, 1 Sep 2022 16:54:05 +0200 Subject: [PATCH] Added support for changing edit icon --- docs/schema/theme.json | 7 +++++++ material/partials/content.html | 3 ++- src/partials/content.html | 3 ++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/schema/theme.json b/docs/schema/theme.json index f8762aab5..6ca89d158 100644 --- a/docs/schema/theme.json +++ b/docs/schema/theme.json @@ -436,6 +436,9 @@ "markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/changing-the-logo-and-icons/", "type": "object", "properties": { + "edit": { + "$ref": "#/definitions/icon" + }, "logo": { "$ref": "#/definitions/icon" }, @@ -550,6 +553,10 @@ }, "additionalProperties": false, "defaultSnippets": [ + { + "label": "edit", + "body": "edit: ${1:material/pencil}" + }, { "label": "logo", "body": "logo: ${1:material/library}" diff --git a/material/partials/content.html b/material/partials/content.html index 39d353ad8..11b7581b4 100644 --- a/material/partials/content.html +++ b/material/partials/content.html @@ -3,7 +3,8 @@ -#} {% if page.edit_url %} - {% include ".icons/material/pencil.svg" %} + {% set icon = config.theme.icon.edit or "material/pencil" %} + {% include ".icons/" ~ icon ~ ".svg" %} {% endif %} {% if "tags" in config.plugins %} diff --git a/src/partials/content.html b/src/partials/content.html index 514987a75..58f798b02 100644 --- a/src/partials/content.html +++ b/src/partials/content.html @@ -27,7 +27,8 @@ title="{{ lang.t('edit.link.title') }}" class="md-content__button md-icon" > - {% include ".icons/material/pencil.svg" %} + {% set icon = config.theme.icon.edit or "material/pencil" %} + {% include ".icons/" ~ icon ~ ".svg" %} {% endif %}