Skip to content

Commit 7956a82

Browse files
committed
Moved back-to-top button to partial
1 parent f8fd537 commit 7956a82

File tree

4 files changed

+38
-15
lines changed

4 files changed

+38
-15
lines changed

material/templates/base.html

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,7 @@
192192
{% include "partials/javascripts/content.html" %}
193193
</div>
194194
{% if "navigation.top" in features %}
195-
<button type="button" class="md-top md-icon" data-md-component="top" hidden>
196-
{% set icon = config.theme.icon.top or "material/arrow-up" %}
197-
{% include ".icons/" ~ icon ~ ".svg" %}
198-
{{ lang.t("top") }}
199-
</button>
195+
{% include "partials/top.html" %}
200196
{% endif %}
201197
</main>
202198
{% block footer %}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{#-
2+
This file was automatically generated - do not edit
3+
-#}
4+
<button type="button" class="md-top md-icon" data-md-component="top" hidden>
5+
{% set icon = config.theme.icon.top or "material/arrow-up" %}
6+
{% include ".icons/" ~ icon ~ ".svg" %}
7+
{{ lang.t("top") }}
8+
</button>

src/templates/base.html

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -355,16 +355,7 @@
355355

356356
<!-- Back-to-top button -->
357357
{% if "navigation.top" in features %}
358-
<button
359-
type="button"
360-
class="md-top md-icon"
361-
data-md-component="top"
362-
hidden
363-
>
364-
{% set icon = config.theme.icon.top or "material/arrow-up" %}
365-
{% include ".icons/" ~ icon ~ ".svg" %}
366-
{{ lang.t("top") }}
367-
</button>
358+
{% include "partials/top.html" %}
368359
{% endif %}
369360
</main>
370361

src/templates/partials/top.html

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<!--
2+
Copyright (c) 2016-2023 Martin Donath <[email protected]>
3+
4+
Permission is hereby granted, free of charge, to any person obtaining a copy
5+
of this software and associated documentation files (the "Software"), to
6+
deal in the Software without restriction, including without limitation the
7+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8+
sell copies of the Software, and to permit persons to whom the Software is
9+
furnished to do so, subject to the following conditions:
10+
11+
The above copyright notice and this permission notice shall be included in
12+
all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
17+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20+
IN THE SOFTWARE.
21+
-->
22+
23+
<!-- Progress indicator -->
24+
<button type="button" class="md-top md-icon" data-md-component="top" hidden>
25+
{% set icon = config.theme.icon.top or "material/arrow-up" %}
26+
{% include ".icons/" ~ icon ~ ".svg" %}
27+
{{ lang.t("top") }}
28+
</button>

0 commit comments

Comments
 (0)