Minimalist, pursuing the ultimate loading speed for a Hexo theme. JS size is 107.73 KB
, after gzip
compression, it's only 33.41 KB
.
For more configuration details, please refer to the "Cosy Starter Guide"
Feature | Disable Option |
---|---|
Theme Switching | |
Prism Syntax Highlighting | |
Algolia Search | |
HeFeng Weather Widget | ✅ |
Katex Formulae | ✅ |
Mermaid Flowcharts | ✅ |
Valine Comments | ✅ |
A Hexo theme managed by pnpm workspace, built with webpack5, and developed using typescript, less, and ejs.
Basic Workflow:
webpack
listens for changes to specified files in the/dockyard/src
directory.- Each file modification triggers
webpack
to rebuild. - Built assets are copied to the
hexo-test/themes
directory. nodemon
monitorshexo-test
, restartingnodemon
to update the Hexo view.
- Install dependencies:
pnpm install
- Configure theme name:
Set theme name in ornn.json
- Start development:
# webpack multi-page build
pnpm dev
# hexo server
pnpm dev:hexo
Create a folder with the module name under apps/dockyard/src/modules
, take yourModule
as an example:
├── ...
├── ...
├── yourModule
│ ├── index.ejs
│ ├── index.ts
└── └── index.less
- index.ejs
<!-- inject:css -->
: Marker for injecting separated CSS by webpack.
<!-- inject:js -->
: Marker for injecting separated JS by webpack.
<!-- inject:css -->
<div>your module content here</div>
<!-- inject:js -->
- index.ts
import './index.less'
// your script here
- index.less
// your stylesheet here
Don't forget to restart the following command:
# Restart webpack
pnpm dev
<%- partial('yourModule') %>
<!-- or -->
<%- include('yourModule') %>
Build command:
pnpm build
After building, the complete Hexo theme assets are output to the dockyard/build
directory.