Pehe: Pehtheme-hugo Enhanced.
Warning
🚨 This theme is not ready for out-of-the-box use.
- With originally features.
- Bugs fixed.
- Features refined.
- Dark mode support.
- Pagefind for search.
- etc...
Pehe is an open-source Hugo theme forked from Pehtheme Hugo. Inspired by Material Design v3, lovingly crafted using Tailwind CSS v4.
Check out the live demo: https://www.eallion.com
To assess the performance of your website using Pehtheme Hugo, utilize the PageSpeed Insights tool. Click the button below to run a PageSpeed Insights test:
- Built with Tailwind CSS v4
- Darkmode support
- WCAG compliance
- Selection posts displayed on the homepage
- Horizontal menus, content tags list
- No JavaScript dependencies
- Vanilla JS toggle button (Theme, Toc, Copy.)
- Two-column blog layout
- Sidebar with a table of contents for the current post
- [or] (if no Toc) Sidebar with one recent post
- Sidebar Profile
- Pagefind for search
- Semantic HTML
To get started with Pehe, follow these steps:
-
Install Hugo and create a new site. For detailed instructions, refer to Hugo's Quick Start Guide.
-
Add Pehe to your project:
git submodule add https://github.com/eallion/pehe.git themes/pehe # or # git clone https://github.com/eallion/pehe.git themes/pehe
-
Simply copy the following folders and contents from the
exampleSitedirectory to the root of your project:themes/pehe/exampleSite/ ├── assets │ ├── chroma.css │ ├── custom.css │ └── input.css ├── config │ └── _default │ ├── hugo.toml │ ├── markup.toml │ ├── mediaTypes.toml │ ├── menus.toml │ ├── module.toml │ ├── outputs.toml │ ├── params.toml │ ├── permalinks.toml │ ├── related.toml │ ├── sitemap.toml │ └── taxonomies.toml ├── content │ ├── _index.md │ ├── about.md │ └── blog │ └── hello-world.md ├── package.json └── postcss.config.js
-
Start Hugo:
pnpm install pnpm dev # pnpm build
You can configure Hugo and Pehe in your config file config/_default/hugo.toml:
baseURL = 'https://www.eallion.com/'
defaultContentLanguage = "zh-cn"
languageCode = 'zh-cn'
languageName = "简体中文"
title = "eallion's Blog"
theme = 'pehe'
[pagination]
pagerSize = 10
[markup]
[markup.goldmark]
[markup.goldmark.renderer]
unsafe = true
+++-
Ensure you have NodeJS installed on your desktop.
-
Copy the Node.js configuration files from the
exampleSitedirectory to the root of your Hugo project:themes/pehe/exampleSite/ ├── assets │ ├── chroma.css │ ├── custom.css │ └── input.css ├── config │ └── _default │ ├── hugo.toml │ ├── markup.toml │ ├── mediaTypes.toml │ ├── menus.toml │ ├── module.toml │ ├── outputs.toml │ ├── params.toml │ ├── permalinks.toml │ ├── related.toml │ ├── sitemap.toml │ └── taxonomies.toml ├── content │ ├── _index.md │ ├── about.md │ └── blog │ └── hello-world.md ├── package.json └── postcss.config.js
-
Customizing the Hugo Theme
After adding the theme, you can start customizing Hugo by leveraging Hugo's template lookup order.
This means you can override the theme's files using your local
layouts/directory.How to Override Files
If you wish to override a file, you have two options:
- Create a file with the same name in your root
layouts/directory. - Copy the file from
themes/pehe/layouts/{*}.htmlto yourlayouts/{*}.htmldirectory and then modify it.
This approach keeps the theme submodule clean and easy to update, allowing you to keep all your customizations isolated within your project's
layouts/directory. - Create a file with the same name in your root
-
How they work:
chroma.csscontains Chroma CSS styles for syntax highlighting.custom.csscontains custom CSS styles for the theme.input.csscontains the input CSS styles for the theme.config/_default/*.tomlare the Hugo configuration files.package.jsoncontains the dependencies and scripts for building the theme.postcss.config.jsconfigures PostCSS to use Tailwind CSS and Autoprefixer for processing CSS files.
-
Run the following command to install necessary dependencies:
pnpm install
-
Generate the Chroma syntax highlight CSS file (replace
onedarkwith your preferred style):hugo gen chromastyles --style=onedark > assets/css/chroma.css -
Customize the theme with Tailwind CSS using the following command:
pnpm dev # pnpm dev:css # pnpm dev:hugo # pnpm dev:pagefind
-
To build the website, execute the command:
pnpm build # pnpm build:chroma # pnpm build:css # pnpm build:hugo # pnpm build:pagefind
-
Icons save in
assets/iconsUsage:
# Simple: {{ partial "icon.html" "github" }} # Advanced: {{ partial "icon.html" (dict "name" "github" "class" "w-6 h-6 text-red-500") }}
Pehtheme Hugo is MIT Licensed. For more details, see the LICENSE file.
Egg fried icon source: Bootstrap Icons - Egg Fried.
Other icons from Simple Icons & Iconify.
Image credits used in the live preview:
```
Default Featured Image:
- https://unsplash.com/photos/OtXJhYjbKeg
```
