laozhu / hugo-nuo

🎨 A responsive light & clean hugo theme for blogger.
https://laozhu.me
MIT License
427 stars 150 forks source link

主页显示一个叫做Posts的连接,而不是文章列表 #141

Open UsirukEsikam opened 4 years ago

UsirukEsikam commented 4 years ago

主页显示一个叫做Posts的连接,而不是文章列表 截图:https://i.loli.net/2019/09/25/aEV4ArWpxSHPkIN.png

小白没找到怎么改,求助。。。

riveryc commented 4 years ago

确实, 我也出现了这个问题, 好像是今天才这样的. 毕竟代码没动过... 是不是某个依赖被改了?

riveryc commented 4 years ago

@laozhu 求助~ 有空帮忙看下, 是不是哪个依赖被修改了? 多谢!

riveryc commented 4 years ago

主页显示一个叫做Posts的连接,而不是文章列表 截图:https://i.loli.net/2019/09/25/aEV4ArWpxSHPkIN.png

小白没找到怎么改,求助。。。

改好了, 把 hugo 降级到0.57.2 就好了. 等老朱来看看是不是因为 hugo 升级了, 某些东西不兼容估计是.

UsirukEsikam commented 4 years ago

主页显示一个叫做Posts的连接,而不是文章列表 截图:https://i.loli.net/2019/09/25/aEV4ArWpxSHPkIN.png 小白没找到怎么改,求助。。。

改好了, 把 hugo 降级到0.57.2 就好了. 等老朱来看看是不是因为 hugo 升级了, 某些东西不兼容估计是.

多谢,我试试

tomriddle1234 commented 4 years ago

复议,0.58.3主页是posts

smithc42 commented 4 years ago

A temporary work-around (on Mac with home brew) until @laozhu manages to fix the issue. Uninstall your current version of hugo and install version 0.57.2

yuyangio commented 4 years ago

同样的问题,不像降级 Hugo,还有其他解决方案吗?

aofch commented 4 years ago

我是升级了hugo版本后才变成这样的。

aofch commented 4 years ago

google很多资料,发送一句话。 There was a breaking change in Hugo 0.57.0 that affected the homepage/index page collection. 大概就是从 0.57.0 版本开始,有一个突破性的变化,会影响到主页数据的集合。

找了半天没在网上找到解决方案。最后看了半天的主题源码,对照着调试解决了。方法如下: 编辑 blog/themes/hugo-nuo/layouts/index.html 文件,找到如下这行代码:

{{ $paginator := .Paginate (where .Data.Pages "Type" "post") (index .Site.Params "paginate" | default 10) }}

修改成这行: {{- $paginator := .Paginate (where site.RegularPages "Type" "in" site.Params.mainSections) -}}

保存文件后,主页就不会以文件夹的方式显示了。