【问题标题】:weight matter in Hugo not taken in account雨果中的重量问题没有考虑到
【发布时间】:2017-10-01 16:40:33
【问题描述】:

我在 2015 年使用 Hugo 制作了一个旧网站,其中包含不同的文章。 它们被正确分类。

现在使用最新的 Hugo,它们显然是按日期而不是按重量排序的。

目录组织如下:

content
    docs
        file1.md
        file2.md
layouts
    docs
        single.html
        summary.html
    partials
        css.html
        header.html
        footer.html
    index.html
static
    img1.png
    img2.png

列表显示在索引文件中

<div id="idx-content">
{{range .Data.Pages}}
    {{.Render "summary"}}
{{end}}
</div>

不幸的是,文件摘要的排序不是按权重排序的。 在.Data.Pages 之后添加.ByWeight 没有帮助。

【问题讨论】:

    标签: hugo


    【解决方案1】:

    事物中的权重值必须大于 0。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多