generator-hexo-theme
Generate a hexo theme
Template choices:
- ejs
- nunjucks
- pug
- swig
Style choices:
- stylus
- sass
- scss
- less
- css
Other:
- hexo scripts directory
- .editorconfig file
- package.json
Install
npm install --global yonpm install --global generator-hexo-theme
Use
If you don't have a site yet create one with hexo init
hexo-cli.
mkdir my-sitecd my-sitehexo init
Navigate to the directory you want to place the theme project in (most likely themes/
).
# from the site root cd themes # make a new theme directory mkdir my-themecd my-theme # generate yo hexo-theme
- Check
_config.yml
in your main blog directory
- Set
theme
property to your theme name, activating this theme
- Check
_config.yml
in your theme directory
- Change menu items if needed
- Change stylesheet and scripts list if needed
- Navigate back to your main blog directory
hexo server --debug
Hexo renderers
It might be necessary to goto the blog root and install a specific renderer for the template language you have chosen. Swig is built into Hexo at the current version.
# templates npm install hexo-renderer-ejsnpm install hexo-renderer-njksnpm install hexo-render-pug # styles npm install hexo-renderer-stylusnpm install hexo-renderer-lessnpm install hexo-renderer-sass
Thank you
Resources -- What is all this for?
- hexo static site generator hexo.io
- Yeoman scaffolding tool yeoman.io
- EditorConfig editorconfig.org