hexojs / hexo-renderer-stylus

Stylus renderer for Hexo
MIT License
18 stars 19 forks source link

feat: configurable plugins #38

Closed curbengh closed 5 years ago

curbengh commented 5 years ago

Based on https://github.com/hexojs/hexo-renderer-stylus/pull/29 @jamelt, with ES6 syntax. Fixes #12 , Closes #29

How to test

$ git clone --depth 1 https://github.com/hexojs/hexo-theme-landscape themes/landscape

config.yml
-theme: current-theme
+theme: landscape

Install this PR branch and Axis (a Stylus plugin),

package.json
-  "hexo-renderer-stylus": "^1.0.0"
+  "hexo-renderer-stylus: "curbengh/hexo-renderer-stylus#plugins",
+  "axis": "^1.0.0"
_config.yml
+stylus:
+  plugins: 'axis'
themes/landscape/source/css/style.styl
+.selector
+  glossy-button()

$ hexo clean && hexo g

public/css/style.css should have

.selector {
  font-size: 13px;
  padding: 10px 22px;
  border-radius: 3px;
  background: #0084f6;
  ...
}
coveralls commented 5 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 3860aa764e83861f58ced736ccb192651e751a56 on curbengh:plugins into cd33c4cc610692141dc1822d2fbac88fb29d3c6c on hexojs:master.