遍历Hugo的迭代页部分

161 阅读1分钟

我需要遍历Hugo中某一特定部分的页面,这意味着markdown文件放在content 下的一个文件夹里,比如content/mysection

下面是实现这一目的的代码:

{{ range (where .Site.Pages "Section" "mysection") }}
  {{ range .Pages }}
    {{ .RelPermalink }} - {{ .Title }} 
  {{ end }}
{{ end }}