Generate a hexo theme
Template choices:
- ejs
- nunjucks
- pug
- swig
Style choices:
- stylus
- sass
- scss
- less
- css
Other:
- hexo scripts
- bower: .bowerrc, bower.json
- npm: package.json
- .gitignore
- .editorconfig
npm install --global slush
npm install --global slush-hexo-themeIf you don't have a site yet create one with hexo init hexo-cli.
mkdir my-site
cd my-site
hexo initNavigate 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-theme
cd my-theme
# generate
slush hexo-themeIt will not automatically overwrite an existing file. Overwrites are confirmed with the user.
- Check
_config.ymlin your main blog directory
- Set
themeproperty to your theme name, activating this theme
- Check
_config.ymlin your theme directory
- Change menu items if needed
- Change stylesheet and scripts list if needed
- Navigate to your main blog directory
hexo server --debug
It might be necessary to goto the blog directory and install a specific renderer for the template language you have chosen. Swig are built into Hexo.
# templates
npm install hexo-renderer-ejs
npm install hexo-renderer-njks
npm install hexo-render-pug
# styles
npm install hexo-renderer-stylus
npm install hexo-renderer-less
npm install hexo-renderer-sass- hexo gitter chat https://gitter.im/hexojs/hexo
- post an issue
It's a community project. Want to help?
- Fix a bug
- GitHub star ⭐
npm star slush-hexo-theme- Do we need to implement any helpers? https://hexo.io/docs/helpers.html
Know another template language hexo users need?
- Fork
- Copy an existing template directory
- Port it to the new language
- Test
- Create pull request
It uses livescript to compile the slushfile.js. It's
handled automatically through the dev script.
# watch the files, re-compile, and test
npm run dev
# build before publishing
npm run prd
# clean up the test site
npm run clean- Theme docs https://hexo.io/docs/themes.html
- Submit your theme whttps://github.com/hexojs/hexo-theme-unit-test
- Slush docs http://slushjs.github.io