【发布时间】:2017-02-21 22:31:01
【问题描述】:
假设我有以下结构
content
- blog-folder-1
-- blog-article-1-1.md
-- blog-article-1-2.md
- blog-folder-2
-- blog-article-2-1.md
-- blog-article-2-2.md
然后我还有layouts/_default/list.html 文件,每次访问example.com/、example.com/blog-topic-1/ 和example.com/blod-topic-2/ 时都会调用该文件
所以我遇到的问题是我不希望layouts/_default/list.html 文件为这些不同的路径生成相同的内容..
通过将++ displayHomepage = "true" ++ 添加到.md 文件并将{{ range $index, $page := first 50 (where .Site.Pages.ByPublishDate ".Params.displayHomepage" "true") }} 添加到list.html 文件,我克服了仅在主页中显示某些文章的问题,但我不知道如果我不这样做该怎么办'访问example.com/blog-folder-1/时不想显示blog-article-2-1.md
任何帮助将不胜感激
【问题讨论】: