Unhandled rejection TypeError: E:\My_Blog\Hexo\f4tb3e\themes\Anatolo\layout\mixins.pug:72
70| - var change = false;
71| - var firstYear = true;
> 72| - page.posts.each(function (item) {
73| - var itemYear = date(item.date, 'YYYY') - 0;
74| - change = year !== itemYear;
75| - year = change ? itemYear : year;
Cannot read property 'each' of undefined
at Object.pug_interp [as postList] (eval at wrap (E:\My_Blog\Hexo\f4tb3e\node_modules\pug-runtime\wrap.js:6:10), <anonymous>:546:12)
at eval (eval at wrap (E:\My_Blog\Hexo\f4tb3e\node_modules\pug-runtime\wrap.js:6:10), <anonymous>:596:23)
at template (eval at wrap (E:\My_Blog\Hexo\f4tb3e\node_modules\pug-runtime\wrap.js:6:10), <anonymous>:641:7)
at _View._compiled (E:\My_Blog\Hexo\f4tb3e\node_modules\hexo\lib\theme\view.js:136:50)
at _View.render (E:\My_Blog\Hexo\f4tb3e\node_modules\hexo\lib\theme\view.js:39:17)
at E:\My_Blog\Hexo\f4tb3e\node_modules\hexo\lib\hexo\index.js:64:21
at tryCatcher (E:\My_Blog\Hexo\f4tb3e\node_modules\bluebird\js\release\util.js:16:23)
at E:\My_Blog\Hexo\f4tb3e\node_modules\bluebird\js\release\method.js:15:34
at RouteStream._read (E:\My_Blog\Hexo\f4tb3e\node_modules\hexo\lib\hexo\router.js:47:5)
at RouteStream.Readable.read (internal/streams/readable.js:462:10)
at resume_ (internal/streams/readable.js:958:12)
at processTicksAndRejections (internal/process/task_queues.js:82:21)
我想创建一个分类页,在source目录下创建了categories文件夹,在其中创建了index.md,内容如下:
在访问(无论是hexo s还是nginx)和生成时均会报错,分类页无法访问(状态码304),报错如下:
补充:不是完全无法使用,例如可访问http://example.blog/categories/Web安全,而不可访问http://example.blog/categories。即生成的public静态文件属于categories的index.html为空白的。