feat: extend tabi <head> and <body> elements (#528)

Co-authored-by: welpo <welpo@users.noreply.github.com>
This commit is contained in:
Cameron Taylor 2025-06-01 08:12:41 -07:00 committed by GitHub
parent 5c1e4acbb1
commit 979f347fb0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 53 additions and 3 deletions

View file

@ -1,7 +1,7 @@
+++
title = "Mastering tabi Settings: A Comprehensive Guide"
date = 2023-09-18
updated = 2025-04-04
updated = 2025-06-01
description = "Discover the many ways you can customise your tabi site."
[taxonomies]
@ -1038,6 +1038,21 @@ All other [h-card properties](https://microformats.org/wiki/h-card#Properties) c
---
## Extending HTML Elements in tabi
Some HTML elements in tabi can be extended to support additional use cases such as adding custom JavaScript for site-wide behavior at the end of the `<body>` tag or including additional content at the end of the `<head>` element that is not otherwise supported by other tabi settings.
See the table below for elements that can be extended:
| Element | Template |
| :------: | :-------------------------------: |
| `<head>` | `templates/tabi/extend_head.html` |
| `<body>` | `templates/tabi/extend_body.html` |
There are no explicit settings to configure for your site or pages. Simply create the relevant template file for your site, and tabi will automatically include it.
---
[^1]: If you're using a remote Git repository, you might want to automate the process of updating the `updated` field. Here's a guide for that: [Zola Git Pre-Commit Hook: Updating Post Dates](https://osc.garden/blog/zola-date-git-hook/).
[^2]: To encode your email in base64 you can use [online tools](https://www.base64encode.org/) or, on your terminal, run: `printf 'mail@example.com' | base64`.