hugo-theme-relearn/exampleSite/content/configuration/customization/partials/index.en.md

47 lines
2.2 KiB
Markdown
Raw Normal View History

2024-09-29 21:48:56 +00:00
+++
2024-10-12 17:28:28 +00:00
categories = ["explanation"]
2024-09-29 21:48:56 +00:00
description = "Modifying partials to your needs"
title = "Partials"
2024-10-06 14:45:11 +00:00
weight = 1
2024-09-29 21:48:56 +00:00
+++
2024-10-12 08:52:54 +00:00
## Usable Partials
You can call other partials from `themes/hugo-relearn-themes/` besides those in `themes/hugo-relearn-themes/layouts/partials/_relearn`. However, using partials not mentioned as customizable below might make future updates more challenging.
2024-09-29 21:48:56 +00:00
## Customizable Partials
2024-10-07 13:30:53 +00:00
The Relearn theme allows you to customize various parts of the theme by overriding partials. This makes the theme highly configurable.
2024-09-29 21:48:56 +00:00
2024-10-07 13:30:53 +00:00
A good rule to follow: The less code a partial contains, the easier it will be to update the theme in the future.
2024-09-29 21:48:56 +00:00
2024-10-07 13:30:53 +00:00
Here's a list of partials you can safely override:
2024-09-29 21:48:56 +00:00
2024-10-07 13:30:53 +00:00
- `layouts/partials/content.html`: The main content of a page. Override this to display additonal page metadata.
2024-09-29 21:48:56 +00:00
2024-10-07 13:30:53 +00:00
- `layouts/partials/content-header.html`: The header above the title. By default, it shows tags, but you can change this.
2024-09-29 21:48:56 +00:00
2024-10-07 13:30:53 +00:00
- `layouts/partials/content-footer.html`: The footer below the content. By default, it shows author info, modification dates, and categories. You can customize this.
2024-09-29 21:48:56 +00:00
2024-10-07 13:30:53 +00:00
- `layouts/partials/custom-header.html`: For adding custom CSS. Remember to include the `style` HTML tag.
2024-09-29 21:48:56 +00:00
2024-10-07 13:30:53 +00:00
- `layouts/partials/custom-footer.html`: For adding custom JavaScript. Remember to include the `script` HTML tag.
2024-09-29 21:48:56 +00:00
2024-10-07 13:30:53 +00:00
- `layouts/partials/favicon.html`: The favicon. You should definitely customize this.
2024-09-29 21:48:56 +00:00
2024-10-07 13:30:53 +00:00
- `layouts/partials/heading.html`: the page's title headings
2024-09-29 21:48:56 +00:00
2024-10-07 13:30:53 +00:00
- `layouts/partials/heading-pre.html`: Add content before the page's title headings. Remember to consider the `headingPre` front matter.
2024-09-29 21:48:56 +00:00
2024-10-07 13:30:53 +00:00
- `layouts/partials/heading-post.html`: Add content after the page's title headings. Remember to consider the `headingPost` front matter.
2024-09-29 21:48:56 +00:00
2024-10-07 13:30:53 +00:00
- `layouts/partials/logo.html`: The logo in the top left corner. You should customize this.
2024-09-29 21:48:56 +00:00
2024-10-07 13:30:53 +00:00
- `layouts/partials/menu-pre.html`: Add content before menu items. Remember to consider the `menuPre` front matter.
2024-09-29 21:48:56 +00:00
2024-10-07 13:30:53 +00:00
- `layouts/partials/menu-post.html`: Add content after menu items. Remember to consider the `menuPost` front matter.
2024-09-29 21:48:56 +00:00
2024-10-07 13:30:53 +00:00
- `layouts/partials/menu-footer.html`: The footer of the left menu.
2024-09-29 21:48:56 +00:00
2024-10-07 13:30:53 +00:00
You can override other partials from `themes/hugo-relearn-themes/`, but be careful as this might make future updates more difficult.