-
-
Notifications
You must be signed in to change notification settings - Fork 7
Theming
Norgolith's theming system allows you to customize the appearance and layout of your site. This guide will walk you through installing, customizing, and creating themes, as well as advanced theming techniques.
Norgolith makes it easy to install and manage themes using the lith theme command.
Important
Currently, Norgolith only supports pulling themes from Git tags. This was done on purpose to try to make a good system around releases and versioning mandatory.
lith theme pull github:NTBBloodbath/norgolith-pico-themelith theme updatelith theme rollbacklith theme infoA Norgolith theme has the following structure:
theme/
├── assets/ # Static files (CSS, JS, images)
├── templates/ # Tera templates for HTML generation
├── theme.toml # Theme metadata
└── .metadata.toml # Theme state (auto-generated)
-
theme.toml: Contains theme metadata likename,versionandauthor. -
templates/: HTML templates using the Tera templating engine. -
assets/: Static files like CSS, JavaScript, and images.
lith theme init
This will prompt for the theme information and create a new theme structure in the theme/ directory:
theme/
├── assets/
├── templates/
└── theme.toml
Add Tera templates to the templates/ directory. Common templates include:
-
base.html: The base template that other templates extend. -
default.html: The default template for every page. -
home.html: The homepage template. -
post.html: The template for individual posts.
Place your CSS, JavaScript, and images in the assets/ directory.
The theme.toml file contains metadata for your theme.
name = "Norgolith Pico"
author = "NTBBloodbath"
description = "PicoCSS for Norgolith"
version = "0.1.0"
license = "MIT"
repository = "github:NTBBloodbath/norgolith-pico-theme"-
name: The name of the theme. -
author: The theme author. -
description: A short description of the theme. -
version: The theme version. -
license: The license under which the theme is distributed. -
repository: The repository URL for the theme.
- Keep your templates modular and reusable.
- Use template inheritance to avoid duplicating code.
- Organize assets into subdirectories (e.g.
assets/css/,assets/js/).
- Use semantic versioning for your theme.
- Remember to create releases for each version of your theme, otherwise people won't be able to use it.
- Ensure compatibility with various screen sizes and devices. This could be done by exposing the development server to your LAN network and accessing the website through different devices.
- Learn more about customizing templates in the Templating Guide.
- Share your theme with the community by publishing it on GitHub!