SukkaW / hexo-theme-suka

🎨Modern, powerful and simple theme for Hexo.
https://theme-suka.skk.moe
GNU General Public License v3.0
615 stars 49 forks source link

Generate Empty File (生成空文件) #132

Closed evrmji closed 4 years ago

evrmji commented 4 years ago

I certify that I have first consulted (check with "x")

我确认我已经查看了 (选择时请使用 "x" 取代方括号中的空格)

I have used Google to search for the troubleshoot , and couldn't found any useful result. Due some reason, I don't have enough debug environment to fix it. 已经使用 Google 等搜索引擎排查报错, 但是并未找到相关结果. 个人原因, 难以展开调试, 遂提交此 issue.

Checkout to master, canary and release tag 1.4.0, but fail and got same result. 使用多个(master, canary, 1.4.0)版本均无效, 得到相同结果.

Build with canary. 用最新 canary 分支构建记录 https://travis-ci.com/evrmji/blog/builds/151980517 https://github.com/evrmji/blog/tree/0e81f7e16589ecbf893afca6d368ad96bc956b99

building log: https://travis-ci.com/evrmji/blog/builds/151980517 deploy date: https://github.com/evrmji/blog/tree/3c4507340acdeaeee0fe8532d4ba2782fb618c84 config file: https://github.com/evrmji/blog/blob/7d1d47414cac5d953a3c813e5bc167e218517b4f/.travis.yml https://github.com/evrmji/blog/blob/7d1d47414cac5d953a3c813e5bc167e218517b4f/_theme_config.yml https://github.com/evrmji/blog/blob/7d1d47414cac5d953a3c813e5bc167e218517b4f/_site_config.yml

Confirmed in other theme could running correctly. 已确认该配置能够在非本主题下正常使用. Working correctly with the default theme. 在默认主题下正常工作. image https://travis-ci.com/evrmji/blog/builds/151978639 https://github.com/evrmji/blog/tree/7d1d47414cac5d953a3c813e5bc167e218517b4f

Still work in forsigner/fexo (theme). 以及在 forsigner/fexo 主题下工作正常 image https://travis-ci.com/evrmji/blog/builds/151982871 https://github.com/evrmji/blog/tree/d719d6596aa2297dbeca3d3c079eca6c49289b22

evrmji commented 4 years ago

The problem solved, as my fault, the commend of copy the configure file have some error, could not copy the configure file into correctly path. 问题已解决, 是因为主题配置文件没有导入.

Without the file _config.yml in the theme path, it will go down and print out (In conclusion): 在缺少主题文件配置的情况下, 会出现以下报错(来自于以下几个位置):

  1. lazyload_img
Cannot read property 'lazyload_img' of undefined
...
...
...
/home/travis/generate/themes/suka/layout/_partial/post/header-info.ejs:5
    3| <% } %>
    4| 
 >> 5| <%
    6|     const lazyloadImgSrc = (theme.vendors.lazyload_img) ? theme.vendors.lazyload_img : url_for('img/suka-lazyload.gif');
    7| %>
    8|
  1. entry_excerpt
Cannot read property 'entry_excerpt' of undefined
...
...
...
/home/travis/generate/themes/suka/layout/_partial/post-entry-content.ejs:9
    7|         <%- strip_html(post.excerpt) %>
    8|     <% } else { %>
 >> 9|         <%- strip_html(truncate(post.content, { length: theme.post.entry_excerpt })) %>
    10|     <% } %><a href="<%= url_for(post.path) %>"><%= __('post.continue') %></a>
    11| </p>
    12| 
  1. theme.busuanzi.enable
Cannot read property 'enable' of undefined
...
...
...
/home/travis/generate/themes/suka/layout/_partial/head/dns-prefetch.ejs:4
    2| 
    3| <!-- busuanzi -->
 >> 4| <% if (theme.busuanzi.enable) { %>
    5|     <link rel="dns-prefetch" href="//busuanzi.ibruce.info">
    6| <% } %>
    7|