iTimeTraveler / hexo-theme-hiker

An attractive theme for Hexo. called "Hiker", short for "HikerNews".
https://itimetraveler.github.io/hexo-theme-hiker/
MIT License
368 stars 84 forks source link

无法生成categories和tags的页面 #9

Open Lid0 opened 7 years ago

Lid0 commented 7 years ago

RT 并且找不到page变量: Unhandled rejection TypeError: D:\Blog\themes\my_hiker\layout\index.ejs:1

1| <%- partial('_partial/archive', {pagination: 2, index: true}) %>

D:\Blog\themes\my_hiker\layout_partial\archive.ejs:2 1| <% if (pagination == 2){ %>

2| <% page.posts.each(function(post){ %> 3| <%- partial('article', {post: post, index: true}) %> 4| <% }) %> 5| <% } else { %>

Cannot read property 'each' of undefined 是我安装的姿势不对还是缺少什么依赖?

iTimeTraveler commented 7 years ago

@Lid0 你可以参考下我的Hexo原始文章目录,https://github.com/iTimeTraveler/hexo-theme-hiero/tree/site-source

Lid0 commented 7 years ago

@iTimeTraveler 多谢! 问题解决了 ~ 还有主题很漂亮!!

iTimeTraveler commented 7 years ago

@Lid0 哈哈哈,多谢咯~ 特别感谢你的鼓励嘿嘿嘿,生活愉快~!

lzslbd commented 7 years ago

我的“分类”和“标签”两个点进去是空的,但是归档和关于是正常的,请问怎么处理呢?

iTimeTraveler commented 7 years ago

@lzslbd 我看到你的主页可以显示了,是不是解决了已经?

ghost commented 7 years ago

@iTimeTraveler 是的哦,就是把 'type' 改成 'layout',这个跟其他主题不一样,所以刚开始一直没发现。。 主题很美,赞一个

iTimeTraveler commented 7 years ago

@wslbd 哈哈哈,谢谢。主要还是hexo主题开发规范太没要求了,大家自己定义自己的字段就很乱。这点比较无奈

fredia commented 7 years ago

@Lid0 请问是怎么解决的呢 我也遇到了这个问题

mlynet commented 7 years ago

@iTimeTraveler ,看了大家的留言,还是没弄明白这个问题时怎么解决的?还请指教.

iTimeTraveler commented 7 years ago

@mlynet 你试着用我的Hexo源目录生成一下,这个应该没问题:https://github.com/iTimeTraveler/hexo-theme-hiero/tree/site-source

如果可以的话,你再对比一下这个目录和你的目录,看看哪块不一样

mlynet commented 7 years ago
  1. hexo new page tags
  2. hexo new page categories
  3. edit source/tags/index.md add line: layout: "tags"
  4. edit source/categories/index.md add line: layout: "categories"
  5. delete db.json
  6. hexo clean
  7. hexo g
LiuHDme commented 7 years ago

解决‘分类’和‘标签’页中没有内容的方法

  1. 打开 Hexo 根目录下的 source - tags - index
  2. 将 type: "tags" 中的 type 改为 layout

以上是对标签页的修改,分类页同理

iTimeTraveler commented 7 years ago

@ssooking 我看到了你给我发的邮件,分类和标签页无法生成的问题可以参考上面这个问题。

你试着用我的Hexo源目录生成一下,对比一下,这个应该没问题:https://github.com/iTimeTraveler/hexo-theme-hiero/tree/site-source

然后来必力是个评论系统,不是广告哈哈,你想要删除的话可以在_config.yml配置文件中去掉livere_shortname这个字段后的内容试试