Option to completely hide the footer from the shell.handlebars template (#836)

* shell.handlebars: remove footer when it is exactly an empty string

With this patch, if the user specifies the footer for the shell as exactly the empty string, then the whole footer is removed from the page. Leaving the footer as null or undefined still shows the "Build with SQLPage" default footer.

* Update CHANGELOG.md
This commit is contained in:
francesco-cattoglio
2025-02-28 14:14:02 +01:00
committed by GitHub
parent 0969495806
commit 35583a5f3e
2 changed files with 13 additions and 10 deletions
+1
View File
@@ -13,6 +13,7 @@
- `markdown_allow_dangerous_html`: allow the usage of html in markdown (default: false)
- `markdown_allow_dangerous_protocol`: allow the usage of custom protocols in markdown (default: false)
- see [configuration.md](./configuration.md) for more details.
- In the shell component, setting the `footer` parameter to the empty string (`''`) will now completely hide the footer, instead of showing the default one
## 0.33.1 (2025-02-25)
+12 -10
View File
@@ -214,16 +214,18 @@
{{~#each_row~}}{{~/each_row~}}
</main>
<footer class="w-100 text-center fs-6 my-2 text-secondary" id="sqlpage_footer">
{{#if footer}}
{{{markdown footer}}}
{{else}}
<!-- You can change this footer using the 'footer' parameter of the 'shell' component -->
Built with <a class="text-reset" href="https://sql-page.com"
title="SQLPage v{{buildinfo 'CARGO_PKG_VERSION'}}">SQLPage</a>
{{/if}}
</footer>
{{#unless (eq footer '')}}
<footer class="w-100 text-center fs-6 my-2 text-secondary" id="sqlpage_footer">
{{#if footer}}
{{{markdown footer}}}
{{else}}
<!-- You can change this footer using the 'footer' parameter of the 'shell' component -->
Built with <a class="text-reset" href="https://sql-page.com"
title="SQLPage v{{buildinfo 'CARGO_PKG_VERSION'}}">SQLPage</a>
{{/if}}
</footer>
{{/unless}}
</div>
</div>
</body>
</html>
</html>