New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hexo s 依旧报错。 #686

Open
arleyGuoLei opened this Issue Aug 2, 2018 · 16 comments

Comments

Projects
None yet
@arleyGuoLei

arleyGuoLei commented Aug 2, 2018

hexo s报错 ,hexo g也报错
1.5.2没错,1.5.5和1.5.6报错。
已经按照 主题以 config.template.yaml 文件取代 config.yaml文件,用以参考配置。 需要手动将 material 文件夹中的 config.template.yaml复制一份并重命名为 config.yaml (并且复制重命名了四份,分别以下名字,还是一样的报错。)

  • config.yaml
  • _config.yaml
  • _config.yml
  • config.yaml

INFO Start processing
INFO Hexo is running at http://localhost:4000/. Press Ctrl+C to stop.
Unhandled rejection TypeError: E:\Blog\i7xy\themes\material\layout\layout.ejs:3
1|
2| <html style="display: none;" <% if(config.language !== null) { %>lang="<%- config.language.substring(0,2) %>"<% } %>>

3| <%- partial('_partial/head') %> (这行报错)
4|
5| <% if(page.layout === 'gallery') { %>
6|

E:\Blog\i7xy\themes\material\layout_partial\head.ejs:22
20|
21|
22| <%- partial('_widget/dnsprefetch') %> (报错)
23|
24|
25|

E:\Blog\i7xy\themes\material\layout_widget\dnsprefetch.ejs:12
10| <% } %>
11|

@xuchaoying

This comment has been minimized.

xuchaoying commented Aug 4, 2018

same here

@Ninefire003

This comment has been minimized.

Ninefire003 commented Aug 4, 2018

我也遇到同样的问题,hexo g时的信息Cannot read property 'startsWith' of null,有时报错信息又为Cannot read property 'pagination_dir' of undefined

@lawler61

This comment has been minimized.

lawler61 commented Aug 5, 2018

哇,一样的问题,好气啊

@Ninefire003

This comment has been minimized.

Ninefire003 commented Aug 6, 2018

/themes/material/_config.yml的这里改false看能不能解决

# Enable generate structured-data as JSON+LD for SEO or not.
    # Set as 'false' if it cause some wrong when `hexo g`.
    structured_data: false
@channg

This comment has been minimized.

channg commented Aug 6, 2018

SAME HERE ,When I wanted to find a solution, the answer was to read the fuck document.

@arleyGuoLei

This comment has been minimized.

arleyGuoLei commented Aug 6, 2018

@Nineburning 前几天装的时候改了试过,配置基本都改了一遍,重启服务,还是一样得报错。你现在改谷歌SEO优化这里,解决问题了吗?(目前我装的是1.5.2版本,没任何错误了, https://i7xy.cn/

@arleyGuoLei

This comment has been minimized.

arleyGuoLei commented Aug 6, 2018

I set it according to the fuck fuck fuck document, but it didn't work out. Have you solved it now? @channg

@Ninefire003

This comment has been minimized.

Ninefire003 commented Aug 6, 2018

@arleyGuoLei 我使用的是1.5.2版本,没有任何错误(戳我查看ninefire.coding.me)。但是1.5.6依旧存在问题,我认为是使用不当造成的错误,没有精力去解决索性就使用1.5.2版本了,反正没太大区别。

@michaelcai

This comment has been minimized.

michaelcai commented Aug 6, 2018

修改layout/_widget/dnsprefetch.ejs文件。修改内容如下:

<% } else if(theme.comment.use.startsWith("disqus")) { %>
// to
<% } else if(theme.comment.use && theme.comment.use.startsWith("disqus")) { %>

原因在于没有对配置做基本的检查。事实上里面很多配置只要任意少一些都会直接炸,没有做任何的默认选项。

因为版本可能改动了文件位置,不过你可以全局搜索关键字,修改方式也是前面加检查即可。

@lawler61

This comment has been minimized.

lawler61 commented Aug 6, 2018

@michaelcai 亲测有用!

@arleyGuoLei

This comment has been minimized.

arleyGuoLei commented Aug 6, 2018

@michaelcai 嗯 有用,没用的先执行一次 hexo clean 即可。

@labhard

This comment has been minimized.

labhard commented Aug 9, 2018

@michaelcai 嗯,终于解决了,谢谢。

cubesky added a commit that referenced this issue Aug 13, 2018

@cubesky

This comment has been minimized.

Collaborator

cubesky commented Aug 13, 2018

fixed in canary

wavky pushed a commit to wavky/hexo-theme-material that referenced this issue Aug 16, 2018

@codevvvv9

This comment has been minimized.

codevvvv9 commented Aug 18, 2018

@michaelcai you are good

@Evilmass

This comment has been minimized.

Evilmass commented Aug 19, 2018

还是提一下吧
项目主页的描述:
注意! 在主题的开发迭代过程中,主题的配置文件模板 可能会改动。为了避免使用 git pull 更新主题的用户出现冲突,我们将 主题配置文件模板 命名为 _config.template.yml。配置主题时,你应该拷贝一份 _config.template.yml 并将其重命名为 _config.yml

文档的描述:
为防止造成冲突,主题以 _config.template.yaml 文件取代 _config.yaml 文件,用以参考配置。 需要手动将 material 文件夹中的 _config.template.yaml 复制一份并重命名为 _config.yaml。

两种命名在本地均可正常运行,但在TravisCI部署的话,第一种命名会报错,第二种不会

EqualMa pushed a commit to EqualMa/hexo-theme-material-awesome that referenced this issue Aug 20, 2018

@geekyouth

This comment has been minimized.

geekyouth commented Sep 4, 2018

@michaelcai

太感谢了,立竿见影

image

image

image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment