feat: add inject support

Co-authored-by: st1020 <me@st1020.com>
This commit is contained in:
Damien LaRocque 2024-10-05 11:12:49 -04:00 committed by GitHub
parent fe3b3a6e14
commit a6cf030459
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 48 additions and 10 deletions

View file

@ -12,6 +12,7 @@ This theme is based on Hugo theme [hugo-paper](https://github.com/nanxiaobei/hug
- Easy to use and modify
- No preset limits (This theme does not limit your content directory structure, taxonomy names, etc. It's applicable to all zola sites.)
- Inject support
- Dark mode
- Responsive design
- Social icons
@ -49,6 +50,20 @@ theme = "kita"
See the `extra` section in [config.toml](https://github.com/st1020/kita/blob/main/config.toml) as a example.
## Inject support
You can easily use inject to add new features to your side without modifying the theme itself.
To use inject, you need to add some HTML files to the `templates/injects` directory.
The available inject points are: `head`, `header_nav`, `body_start`, `body_end`, `page_start`, `page_end`, `footer`, `page_info`.
For example, to load a custom script, you can add a `templates/injects/head.html` file:
```html
<script src="js-file-path-or-cdn-url.js"></script>
```
## License
[MIT License](https://github.com/st1020/kita/blob/main/LICENSE)