Skip to content
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

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

Open
UsirukEsikam opened this issue Sep 25, 2019 · 9 comments
Open

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

UsirukEsikam opened this issue Sep 25, 2019 · 9 comments

Comments

@UsirukEsikam
Copy link

UsirukEsikam commented Sep 25, 2019

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

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

@riveryc
Copy link

riveryc commented Sep 25, 2019

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

@riveryc
Copy link

riveryc commented Sep 25, 2019

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

@riveryc
Copy link

riveryc commented Sep 25, 2019

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

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

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

@UsirukEsikam
Copy link
Author

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

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

多谢,我试试

@tomriddle1234
Copy link

复议,0.58.3主页是posts

@smithc42
Copy link

smithc42 commented Oct 8, 2019

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

  • brew uninstall hugo --force
  • brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/b3375784ad033442c182caac5240fbe4d0a3d581/Formula/hugo.rb

@yuyangio
Copy link

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

@aofch
Copy link

aofch commented Jan 6, 2020

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

@aofch
Copy link

aofch commented Jan 6, 2020

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) -}}

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

madneal added a commit to madneal/hugo-nuo that referenced this issue May 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants