Ability to turn on "go to top" button on regular pages (fixes #115)

This commit is contained in:
daudix
2025-03-30 07:51:32 +03:00
parent fe079da67b
commit 337855cfce
2 changed files with 6 additions and 0 deletions

View File

@ -1,6 +1,7 @@
+++ +++
title = "Demo Page" title = "Demo Page"
[extra] [extra]
go_to_top = true
styles = ["demo/demo.css"] styles = ["demo/demo.css"]
scripts = ["demo/demo.js"] scripts = ["demo/demo.js"]
katex = true katex = true

View File

@ -24,6 +24,11 @@
{%- endif -%} {%- endif -%}
<main id="main-content"> <main id="main-content">
{% block custom %}{% endblock custom %} {% block custom %}{% endblock custom %}
{%- if page.extra.go_to_top or section.extra.go_to_top -%}
<div id="buttons-container">
<a id="go-to-top" href="#top" title="{{ macros_translate::translate(key='go_to_top', default='Go to Top', language_strings=language_strings) }}"><i class="icon"></i></a>
</div>
{%- endif -%}
{% block content %}{% endblock content %} {% block content %}{% endblock content %}
{% include "partials/extra_features.html" %} {% include "partials/extra_features.html" %}
</main> </main>