kevinma2010 / hexo-theme-vno

The Ghost Vno theme ported to Hexo
MIT License
158 stars 28 forks source link

Cannot read property 'substring' of null #15

Open cblh opened 7 years ago

cblh commented 7 years ago

_config.yml如果不填写description的话,代码会报错

Unhandled rejection TypeError: /Users/burlinchen/Projects/git-master/blog/themes/vno/layout/layout.ejs:1
 >> 1| <%- partial('_partial/head') %>
    2| <body class="home-template no-js">
    3|
    4|     <span class="mobile btn-mobile-menu">

/Users/burlinchen/Projects/git-master/blog/themes/vno/layout/_partial/head.ejs:6
    4|     <meta charset="utf-8"/>
    5|     <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
 >> 6|     <%
    7|     var title = page.title;
    8|     title = title ? (title + ' | ' + config.title) : (config.subtitle ? config.title + " | " + config.subtitle : config.title);
    9|

Cannot read property 'substring' of null

出错代码在下面

https://github.com/lenbo-ma/hexo-theme-vno/blob/521ef7080106418729c2b4e9e7002c82a24123b6/layout/_partial/head.ejs#L18

ghost commented 7 years ago

Inside the sites _config.yml , description: cannot be empty with the current code. Putting "" will bypass it.