letiantian / huno

A responsible theme for Hexo
494 stars 114 forks source link

theme doesn't work with hexo 2.8.3 #3

Closed codepreneur closed 10 years ago

codepreneur commented 10 years ago

When I install the theme and run hexo server I get this (but only when I actually visit http://localhost:4000/):

 ~/test-hexo  hexo server
[info] Hexo is running at http://localhost:4000/. Press Ctrl+C to stop.
TypeError: Cannot read property 'substring' of null
    at eval (eval at <anonymous> (/Users/johndoe/test-hexo/node_modules/hexo-renderer-ejs/node_modules/ejs/lib/ejs.js:242:14), <anonymous>:66:30)
    at eval (eval at <anonymous> (/Users/johndoe/test-hexo/node_modules/hexo-renderer-ejs/node_modules/ejs/lib/ejs.js:242:14), <anonymous>:67:4294)
    at /Users/johndoe/test-hexo/node_modules/hexo-renderer-ejs/node_modules/ejs/lib/ejs.js:255:15
    at Object.exports.render (/Users/johndoe/test-hexo/node_modules/hexo-renderer-ejs/node_modules/ejs/lib/ejs.js:293:13)
    at /Users/johndoe/test-hexo/node_modules/hexo-renderer-ejs/index.js:5:14
    at Domain.<anonymous> (/usr/local/lib/node_modules/hexo/lib/extend/renderer.js:78:38)
    at Domain.run (domain.js:197:16)
    at store.(anonymous function) (/usr/local/lib/node_modules/hexo/lib/extend/renderer.js:77:9)
    at /usr/local/lib/node_modules/hexo/lib/core/render.js:96:9
    at fn (/usr/local/lib/node_modules/hexo/node_modules/async/lib/async.js:641:34)
TypeError: Cannot read property 'substring' of null
    at eval (eval at <anonymous> (/Users/johndoe/test-hexo/node_modules/hexo-renderer-ejs/node_modules/ejs/lib/ejs.js:242:14), <anonymous>:66:30)
    at eval (eval at <anonymous> (/Users/johndoe/test-hexo/node_modules/hexo-renderer-ejs/node_modules/ejs/lib/ejs.js:242:14), <anonymous>:67:4294)
    at /Users/johndoe/test-hexo/node_modules/hexo-renderer-ejs/node_modules/ejs/lib/ejs.js:255:15
    at Object.exports.render (/Users/johndoe/test-hexo/node_modules/hexo-renderer-ejs/node_modules/ejs/lib/ejs.js:293:13)
    at /Users/johndoe/test-hexo/node_modules/hexo-renderer-ejs/index.js:5:14
    at Domain.<anonymous> (/usr/local/lib/node_modules/hexo/lib/extend/renderer.js:78:38)
    at Domain.run (domain.js:197:16)
    at store.(anonymous function) (/usr/local/lib/node_modules/hexo/lib/extend/renderer.js:77:9)
    at /usr/local/lib/node_modules/hexo/lib/core/render.js:96:9
    at fn (/usr/local/lib/node_modules/hexo/node_modules/async/lib/async.js:641:34)

Let me know if you can help.

letiantian commented 10 years ago

The 43rd line of layout/layout.ejs is

description = description.substring(0, 200).replace(/^\s+|\s+$/g, '');

Please check your _config.yml of hexo, and make sure the the value of description is not null.

codepreneur commented 10 years ago

That solved the issue, thank you.