Use marko v4 template in Hexo.
npm install hexo-renderer-markojsbash
$ npm install --save hexo-renderer-markojs
`
$3
Create a layout file index.marko.
`html
class {
onCreate() {
this.state = {
name: 'hello',
};
}
}
Home
Hello Word
${data.page.total}
${state.name}
`
All hexo local variables are in the data property.
`js
${data.page} Page specific information and custom variables set in front-matter.
${data.site} Sitewide information.
${data.config} Site configuration.
${data.theme} Theme configuration. Inherits from site configuration.
${data.env} Environment variables
...
``