CaiJimmy / hugo-theme-stack

Card-style Hugo theme designed for bloggers

Home Page:https://stack.jimmycai.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature Request: Support GitInfo in LastModified

delize opened this issue · comments

What happened?

Currently, Hugo supports last modified timestamps for Blog Posts using Git: https://gohugo.io/methods/page/gitinfo/

However, it doesn't seem like this is natively supported in the Stack theme. When enabled or added to: https://github.com/CaiJimmy/hugo-theme-stack-starter/blob/master/config/_default/config.toml

Using: https://gohugo.io/getting-started/configuration/#configure-dates

This appears to cause issues when creating new blog posts or modifications due to the syntax being used across the blog theme.

It would be nice if this was fully supported - so that people wouldn't have to rely on manually inputting last modified dates.

Hugo version

0.120

Theme version

3.24.2

What browsers are you seeing the problem on?

No response

More information about the browser

No response

Relevant log output

No response

Link to Minimal Reproducible Example

https://github.com/CaiJimmy/hugo-theme-stack-starter

I have same problem. here is the log when run ' hugo server ' command :
execute of template failed: template: partials/head/opengraph/include.html:1:3: executing "partials/head/opengraph/include.html" at < partial "head/opengraph/provider/base" .>: error calling partial: "AppData\Local\hugo_cache\modules\filecache\modules\pkg\mod\github.com\!cai!jimmy\hugo-theme-stack\v3@v3.24.2\layouts\partial s\head\opengraph\provider\base.html:35:20": execute of template failed: template: partials/head/opengraph/provider/base.html:35:20: executing "partials/head/opengraph/provider/base.html" at <.Site.Lastmod .IsZero>: can't evaluate field Lastmod in type page.Site

@sailingsky this could be a different problem. See the pinned issue.
#974

This issue is more for architectural changes to incorporate last modified, determine how syntax should appear and where when gitinfo is enabled, etc.

One can of course enable Gitinfo, but, there were all sorts of issues getting it to work / format cleanly without altering mass amounts of code.

@sailingsky this could be a different problem. See the pinned issue. #974

This issue is more for architectural changes to incorporate last modified, determine how syntax should appear and where when gitinfo is enabled, etc.

One can of course enable Gitinfo, but, there were all sorts of issues getting it to work / format cleanly without altering mass amounts of code.

thx, I fixed it.

I have tested the starter template locally with enableGitInfo = true enabled and it seems to work fine. It seems to be related to the CI configuration of the starter template. I believe this issue can be resolved by CaiJimmy/hugo-theme-stack-starter#39

I'm going to close this issue and merge this pull request. Feel free to reopen it if this solution does not work.