theNewDynamic / gohugo-theme-ananke

Ananke: A theme for Hugo Sites
https://gohugo-ananke-theme-demo.netlify.com/
MIT License
1.09k stars 1.12k forks source link

Extra {{end}} index.html #687

Closed LoadingStill closed 2 months ago

LoadingStill commented 2 months ago

File: /themes/ananke/layouts/index.html

Error I am receiving: (my foldre path vscode)% hugo Start building sites … hugo v0.125.2-4e483f5d4abae136c4312d397a55e9e1d39148df+extended darwin/arm64 BuildDate=2024-04-20T15:29:44Z VendorInfo=brew

Total in 116 ms Error: error building site: render: failed to render pages: render of "home" failed: "(my file path)/themes/ananke/layouts/index.html:48:23": execute of template failed: template: index.html:48:23: executing "main" at <.Site.GetPage>: can't evaluate field Site in type string

I believe there is an extra {{end}} at the end of the iindex.html file. I am new to Hugo and may be incorrect here as this error only happens when importing an older post and not when creating a new post. But removing the last {{end}} I am no longer receiving this error.

LoadingStill commented 2 months ago

Looks like you just need to add a $ on line 48 before the first period. And after I found that, I located the previous issue about that.

LoadingStill commented 2 months ago

I am unsure if the fix was implemented into index.html, so I will not close at this time to let the maintainer close if it has. I see the pull request in #665, But not able to see the correct code in the master branch.

ramiro commented 2 months ago

Yes. This is a duplicate of #685 (which is an issue report and a fix PR).

The PR has not been reviewed/accepted/merged into master that's why you don't see the proposed change there yet.

You can close this one as duplicate.