Skip to content

Commit 04ba8db

Browse files
committed
fix(docs): add sponsor heart button via header template override
1 parent 3d8ba54 commit 04ba8db

3 files changed

Lines changed: 89 additions & 2 deletions

File tree

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
{#-
2+
This file was automatically generated - do not edit
3+
-#}
4+
{% set class = "md-header" %}
5+
{% if "navigation.tabs.sticky" in features %}
6+
{% set class = class ~ " md-header--shadow md-header--lifted" %}
7+
{% elif "navigation.tabs" not in features %}
8+
{% set class = class ~ " md-header--shadow" %}
9+
{% endif %}
10+
<header class="{{ class }}" data-md-component="header">
11+
<nav class="md-header__inner md-grid" aria-label="{{ lang.t('header') }}">
12+
<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">
13+
{% include "partials/logo.html" %}
14+
</a>
15+
<label class="md-header__button md-icon" for="__drawer">
16+
{% set icon = config.theme.icon.menu or "material/menu" %}
17+
{% include ".icons/" ~ icon ~ ".svg" %}
18+
</label>
19+
<div class="md-header__title" data-md-component="header-title">
20+
<div class="md-header__ellipsis">
21+
<div class="md-header__topic">
22+
<span class="md-ellipsis">
23+
{{ config.site_name }}
24+
</span>
25+
</div>
26+
<div class="md-header__topic" data-md-component="header-topic">
27+
<span class="md-ellipsis">
28+
{% if page.meta and page.meta.title %}
29+
{{ page.meta.title }}
30+
{% else %}
31+
{{ page.title }}
32+
{% endif %}
33+
</span>
34+
</div>
35+
</div>
36+
</div>
37+
{% if config.theme.palette %}
38+
{% if not config.theme.palette is mapping %}
39+
{% include "partials/palette.html" %}
40+
{% endif %}
41+
{% endif %}
42+
{% if not config.theme.palette is mapping %}
43+
{% include "partials/javascripts/palette.html" %}
44+
{% endif %}
45+
{% if config.extra.alternate %}
46+
{% include "partials/alternate.html" %}
47+
{% endif %}
48+
{% if "material/search" in config.plugins %}
49+
{% set search = config.plugins["material/search"] | attr("config") %}
50+
{% if search.enabled %}
51+
<label class="md-header__button md-icon" for="__search">
52+
{% set icon = config.theme.icon.search or "material/magnify" %}
53+
{% include ".icons/" ~ icon ~ ".svg" %}
54+
</label>
55+
{% include "partials/search.html" %}
56+
{% endif %}
57+
{% endif %}
58+
{% if config.repo_url %}
59+
<div class="md-header__source">
60+
<a href="https://github.com/sponsors/kdroidFilter" title="Sponsor" class="md-source__sponsor">
61+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="20" height="20">
62+
<path fill="#e91e63" d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/>
63+
</svg>
64+
</a>
65+
{% include "partials/source.html" %}
66+
</div>
67+
{% endif %}
68+
</nav>
69+
{% if "navigation.tabs.sticky" in features %}
70+
{% if "navigation.tabs" in features %}
71+
{% include "partials/tabs.html" %}
72+
{% endif %}
73+
{% endif %}
74+
</header>

docs/stylesheets/extra.css

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,17 @@
5353
.md-social {
5454
display: none;
5555
}
56+
57+
/* Sponsor heart button in header */
58+
.md-source__sponsor {
59+
display: inline-flex;
60+
align-items: center;
61+
margin-right: 0.6rem;
62+
vertical-align: middle;
63+
opacity: 0.8;
64+
transition: opacity 0.2s;
65+
}
66+
67+
.md-source__sponsor:hover {
68+
opacity: 1;
69+
}

mkdocs.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ edit_uri: edit/main/docs/
77

88
theme:
99
name: material
10+
custom_dir: docs/overrides
1011
palette:
1112
- media: "(prefers-color-scheme: light)"
1213
scheme: default
@@ -98,5 +99,3 @@ extra:
9899
link: https://github.com/kdroidFilter/Nucleus
99100
- icon: simple/kofi
100101
link: https://ko-fi.com/lomityaesh
101-
sponsor:
102-
link: https://github.com/sponsors/kdroidFilter

0 commit comments

Comments
 (0)