Lamb comes with two built in themes: default and 2024.
I’m not a designer.
- Default is a traditional blog theme
- 2024 is a more open modern theme. It’s build on top of default.
To switch between themes, set the theme key in the site configuration at /settings:
theme = 2024
Lamb also supports user themes in the same way. Simply create your own theme directory and assign it to the theme key. It’s recommended to version control your theme as it’s own git repo. This allows you to update Lamb and your theme separately using git.
Screenshots
Default:
2024:
Theme documentation
- All functions available in theme.php can be reused in the theme.
- A theme does not need to provide every file. Lamb falls back to
src/themes/default/when a file is missing in the active theme. - The only file path that is always expected in the active theme is
styles/styles.css, becausethe_styles()always loads that stylesheet from the selected theme. html.phpis only needed when you want to change the outer page layout.feed.phpis only needed when you want to change the Atom feed output.- Use the
part($basename)function to load any other theme includes. This enables a fallback to the default theme’s files if the file does not exist in the theme. This makes the default theme is a requirement for the 2024 theme. - CSS stylesheets must be saved in a subfolder of the theme called
styles/and are loaded usingthe_styles(). the_styles()takes no arguments and loadsstyles/styles.cssfrom the active theme.the_scripts()takes no arguments and loads application scripts fromsrc/scripts/, not from the active theme directory.the_scripts()always loadssrc/scripts/shorthand.js.- Logged-in users additionally get the admin scripts in
src/scripts/logged_in/.
Have a look at the pre-existing themes for examples of the above.
Any suggestions to improve theming are welcomed.
Related
- Site Configuration: Set the
themekey in the config to activate a theme.