Skip to content

Commit 909591e

Browse files
committed
Added support for changing edit icon
1 parent 9136153 commit 909591e

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

docs/schema/theme.json

+7
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,9 @@
436436
"markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/changing-the-logo-and-icons/",
437437
"type": "object",
438438
"properties": {
439+
"edit": {
440+
"$ref": "#/definitions/icon"
441+
},
439442
"logo": {
440443
"$ref": "#/definitions/icon"
441444
},
@@ -550,6 +553,10 @@
550553
},
551554
"additionalProperties": false,
552555
"defaultSnippets": [
556+
{
557+
"label": "edit",
558+
"body": "edit: ${1:material/pencil}"
559+
},
553560
{
554561
"label": "logo",
555562
"body": "logo: ${1:material/library}"

material/partials/content.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
-#}
44
{% if page.edit_url %}
55
<a href="{{ page.edit_url }}" title="{{ lang.t('edit.link.title') }}" class="md-content__button md-icon">
6-
{% include ".icons/material/pencil.svg" %}
6+
{% set icon = config.theme.icon.edit or "material/pencil" %}
7+
{% include ".icons/" ~ icon ~ ".svg" %}
78
</a>
89
{% endif %}
910
{% if "tags" in config.plugins %}

src/partials/content.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
title="{{ lang.t('edit.link.title') }}"
2828
class="md-content__button md-icon"
2929
>
30-
{% include ".icons/material/pencil.svg" %}
30+
{% set icon = config.theme.icon.edit or "material/pencil" %}
31+
{% include ".icons/" ~ icon ~ ".svg" %}
3132
</a>
3233
{% endif %}
3334

0 commit comments

Comments
 (0)