Open codepreneur opened 9 years ago
Hmm looks like hexo-handlebars isn't rendering for some reason. Is it installed?
On Sun, Nov 2, 2014, 6:14 AM Vaidas Mykolaitis notifications@github.com wrote:
When I git clone git@github.com:jaredly/hexium.git themes/hexium and then hexo server when I go to the browser I get:
{{! Document Settings }} {{! Page Meta }} {{! Styles'n'Scripts }} {{! Ghost outputs important style and meta data with this tag }} {{ghost_head}} {{! Everything else gets inserted here }} {{{body}}} {{! Ghost outputs important scripts and data with this tag }} {{ghost_foot}} {{! The main JavaScript file for Casper }} {{#if theme.ga_id}} {{/if}}
Help :)
— Reply to this email directly or view it on GitHub https://github.com/jaredly/hexium/issues/3.
This is my package.json
{
"name": "hexo-site",
"version": "2.8.3",
"private": true,
"dependencies": {
"handlebars": "^2.0.0",
"hexo-renderer-ejs": "*",
"hexo-renderer-handlebars": "^0.1.1",
"hexo-renderer-marked": "*",
"hexo-renderer-stylus": "*",
"moment": "^2.8.3"
}
}
I found what the problem was:
<link rel="shortcut icon" href="{{asset theme.favicon}}">
this line of code inside of layout.hbs
throws an error because it is undefined so if you comment it out, it works.
I can confirm a similar issue on my hexo 2.8.3 instance and @codepreneur's workaround helped. seems the that template line might have caused this error when running hexo generate
$ hexo generate
[info] Files loaded in 0.064s
[error] HexoError: Render failed: archives/index.html
TypeError: Cannot call method 'slice' of undefined
at Object.module.exports.asset (/home/yuvilio/ws/sites/hexo/hexo-hexium/themes/hexium/helper/index.js:19:14)
at Object.eval (eval at <anonymous> (/home/yuvilio/ws/sites/hexo/hexo-hexium/node_modules/hexo-renderer-handlebars/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:189:23), <anonymous>:42:120)
at /home/yuvilio/ws/sites/hexo/hexo-hexium/node_modules/hexo-renderer-handlebars/node_modules/handlebars/dist/cjs/handlebars/runtime.js:86:31
at /home/yuvilio/ws/sites/hexo/hexo-hexium/node_modules/hexo-renderer-handlebars/node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js:465:21
at handlebarsRenderer (/home/yuvilio/ws/sites/hexo/hexo-hexium/node_modules/hexo-renderer-handlebars/index.js:32:10)
at /home/yuvilio/.nvm/v0.10.33/lib/node_modules/hexo/lib/extend/renderer.js:78:38
at b (domain.js:183:18)
at Domain.run (domain.js:123:23)
at store.(anonymous function) (/home/yuvilio/.nvm/v0.10.33/lib/node_modules/hexo/lib/extend/renderer.js:77:9)
at /home/yuvilio/.nvm/v0.10.33/lib/node_modules/hexo/lib/core/render.js:96:9
Also, my hexium's package.json didn't seem to have the packages needed:
$ cat themes/hexium/package.json
{
"name" : "Readium",
"version" : "2.0.0",
"description" : "Just a medium-like blogging platform.",
"author" : "Sven Read",
"homepage" : "http://www.svenread.com/readium"
}
$ cd themes/hexium/
$ ls -lh package.json
-rwxrwxr-x 1 yuvilio yuvilio 212 Dec 8 13:20 package.json
$ npm install
npm WARN package.json Readium@2.0.0 No repository field.
$
I had to npm install
those packages separately for the theme to work:
$ npm install --save handlebars hexo-renderer-handlebars moment
When I
git clone git@github.com:jaredly/hexium.git themes/hexium
then changetheme
tohexium
in_config.yml
and thenhexo server
when I go to the browser I get:If I then do
npm install hexo-renderer-handlebars --save
I get :If I then
npm i moment --save
then I get:Help :)