hexo-theme-hipaper icon indicating copy to clipboard operation
hexo-theme-hipaper copied to clipboard

categories和tags页面404

Open icanfly opened this issue 8 years ago • 14 comments

请问应用了您的主题后categories和tags 出现了404 Not found的错误,请问是怎么回事呢,我看了您的示例,categories和tags是可用的。我用的是hexo 3.2.2

icanfly avatar Jan 12 '17 01:01 icanfly

@icanfly 你可以参考一下我的Hexo源目录: https://github.com/iTimeTraveler/hexo-theme-hiero/tree/site-source

iTimeTraveler avatar Jan 12 '17 02:01 iTimeTraveler

@iTimeTraveler 非常感谢,之前设置成type: "tags"了,导致不成功,受其它主题影响,而您这个主题是设置layout: "tags"

icanfly avatar Jan 12 '17 02:01 icanfly

@icanfly 这块确实比较乱,我也被困扰过很久。。

iTimeTraveler avatar Jan 12 '17 02:01 iTimeTraveler

@iTimeTraveler 还有一个问题,请问如何设置404页面呢,如果访问的url不存在会出现光突突的404 not found

icanfly avatar Jan 12 '17 08:01 icanfly

@icanfly ok,我更新了我上面的Hexo源目录: https://github.com/iTimeTraveler/hexo-theme-hiero/tree/site-source 在 source/目录下你可以看到一个404.html 你看看这个就好了,Hexo支持原生的html页面。

我参考的是知乎的这个回答:hexo 怎么创建 404 页面? 你试试吧

iTimeTraveler avatar Jan 12 '17 10:01 iTimeTraveler

@iTimeTraveler 非常感谢。

icanfly avatar Jan 13 '17 06:01 icanfly

@iTimeTraveler @icanfly 给楼上两位兄弟点赞!

tangkunyin avatar Feb 04 '17 08:02 tangkunyin

请问你一下,顶部header那边的Categories,Tags,About点击后都提示: Cannot GET /categories/ Cannot GET /tags/ Cannot GET /about/ 这个是为什么呢?T_T...

niniyang avatar Apr 28 '17 03:04 niniyang

@niniyang 你参考一下我上面贴的Hexo的源目录,应该就能解决

iTimeTraveler avatar Apr 28 '17 06:04 iTimeTraveler

您好,参考贴的源目录的意思是直接down下来然后覆盖原目录吗?

justinmars avatar Apr 01 '18 14:04 justinmars

@justinmars 不建议覆盖你的原目录,最好单独新建一个目录用来测试,然后对比你的和我这个目录中的区别就能解决很多问题了

iTimeTraveler avatar Apr 02 '18 02:04 iTimeTraveler

More explicitly, if you're getting a "Cannot get /categories/" error, I figured out that I needed to make a new page i.e. $ hexo new page categories $ hexo new page tags

and then in the frontmatter put layout: "categories" layout: "tags"

respectively. (I first had type: "tags" which didn't work). The post should be blank otherwise. See https://raw.githubusercontent.com/iTimeTraveler/hexo-theme-hiero/site-source/source/categories/index.md

After that, you should get a page showing up at localhost:4000/categories or wherever your blog is

nro-bot avatar May 26 '18 20:05 nro-bot

原來是layout: "tags" 我想說怎麼到底文件在哪裡 _config都找不到

順便問一下 為甚麼 archieves 不用生出 hexo new page *** 就可以有default layout ? Why archieves dont need to hexo new page and change the layout?

jayzhan211 avatar Jun 24 '18 13:06 jayzhan211

之前看到的官网说明一直是 type: "tags" 之后修改为 layout: "tags" 网页竟然显示正常了~

muzi-8 avatar Aug 09 '18 12:08 muzi-8