Skip to content

GitInfo unset when file path contains bytes > 0x80 #9810

@slnc

Description

@slnc

GitInfo doesn't seem to be set when a page has exactly 1 commit. I have a partial with this (simplified) code:

{{- $recent := where .Site.RegularPages.ByLastmod.Reverse "Type" "eq" "notes" }}
{{- $recent_num := (.Site.Params.widgets.recent_num | default 10) }}

{{- if $recent }}

    {{- range first $recent_num $recent }} {{- if ne .Title "" }} {{ .GitInfo }} {{ $lastmod := .Lastmod.Format "Jan 2, 2006" }}
  • {{ .Title }}
    {{ $lastmod }}
  • {{- end }} {{- end }}
{{- end }}

Which prints this:

Screen Shot 2022-04-21 at 19 23 18

The file has exactly 1 commit:

Screen Shot 2022-04-21 at 19 24 04

All the other files have more than 1 commit. From Hugo's Lastmod and GitInfo doc pages I expect that pages with exactly 1 commit have GitInfo populated like pages with more than 1 commit.

My config.toml [frontmatter] config looks like this:

[frontmatter] date = ["date", "publishDate", "lastmod"] lastmod = ["lastmod", ":git", "date", "publishDate"] publishDate = ["publishDate", "date"]

What version of Hugo are you using (hugo version)?

hugo v0.97.3-078053a43d746a26aa3d48cf1ec7122ae78a9bb4 darwin/amd64 BuildDate=2022-04-18T17:22:19Z VendorInfo=gohugoio

Does this issue reproduce with the latest release?

Yes

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions