This is my first post and my first try with Hugo. I am mainly impressed with its small footprint and fast rendering of pages.
I need your valuable help in creating my website theme from Jekyll website theme named “Affiliates”. Using ChatGPT i am able to convert all pages. However, when i run “Hugo” to render the site, it shoots up multiple errors:
abc@ES-Mac askme % hugo
Start building sites …
hugo v0.134.3+extended darwin/arm64 BuildDate=2024-09-19T14:28:20Z VendorInfo=brew
ERROR render of "term" failed: execute of template failed: html/template:taxonomy/category.html:88:138: {{.Permalink}} appears in an ambiguous context within a URL
ERROR render of "page" failed: execute of template failed: html/template:_default/single.html:88:138: {{.Permalink}} appears in an ambiguous context within a URL
ERROR render of "page" failed: execute of template failed: html/template:_default/post.html:88:138: {{.Permalink}} appears in an ambiguous context within a URL
Total in 33 ms
Error: error building site: render: failed to render pages: render of "home" failed: "/Users/abc/Desktop/askme/layouts/index.html:65:19": execute of template failed: template: index.html:65:19: executing "index.html" at <partial "pagination.html" $paginator>: error calling partial: "/Users/abc/Desktop/askme/layouts/partials/pagination.html:8:20": execute of template failed: template: partials/pagination.html:8:20: executing "partials/pagination.html" at <.Page>: can't evaluate field Page in type *page.Pager
abc@ES-Mac askme %
Here is a Google Drive link to the zipped site. Any help would be most appreciated.
**Edit : ** Here is the Github public repository link:
the line numbers are not to be found in the mentioned files. Initially they were {{.url}} but was getting same errors exactly on same line numbers (the code doesn’t reach that line numbers in any of the files). So as per chatgpt solution, i had to change them from {{.url}} to {{.Permalink}}. The config.toml file is also present. I am an amateur trying to learn hugo and right now just trying to convert the jekyll site and make it work on hugo, so that i can upload it to my custom domain for blogging purpose ( i like this theme!) . So don’t have much understanding on what you mentioned. Thanks again.
> git clone https://github.com/askeijaz/AskMe
Cloning into 'AskMe'...
remote: Enumerating objects: 89, done.
remote: Counting objects: 100% (89/89), done.
remote: Compressing objects: 100% (72/72), done.
remote: Total 89 (delta 13), reused 85 (delta 12), pack-reused 0 (from 0)
Receiving objects: 100% (89/89), 2.64 MiB | 2.68 MiB/s, done.
Resolving deltas: 100% (13/13), done.
> cd AskMe
> hugo
Total in 2 ms
Error: failed to load modules: module "" not found in "C:\\_repos\\github\\hugo-forum\\AskMe\\themes"; either add it as a Hugo Module or store it in "C:\\_repos\\github\\hugo-forum\\AskMe\\themes".: module does not exist
looks like you are mixing a site and theme into one folder. Did the following to reproduce your error messages:
> hugo new askme_site
> cd askme_site
> git clone https://github.com/askeijaz/AskMe themes/AskMe
> echo "theme = 'AskMe'" >> hugo.toml
> hugo
hugo v0.134.3-5fb333b9f5ff4ec018f9d78910177d0bec1befb0+extended windows/amd64 BuildDate=2024-09-19T14:28:20Z VendorInfo=gohugoio
ERROR render of "page" failed: execute of template failed: html/template:_default/single.html:88:138: {{.Permalink}} appears in an ambiguous context within a URL
ERROR render of "page" failed: execute of template failed: html/template:_default/post.html:88:138: {{.Permalink}} appears in an ambiguous context within a URL
ERROR render of "taxonomy" failed: execute of template failed: html/template:taxonomy/terms.html:88:138: {{.Permalink}} appears in an ambiguous context within a URL
ERROR render of "section" failed: execute of template failed: html/template:_default/section.html:88:138: {{.Permalink}} appears in an ambiguous context within a URL
Total in 142 ms
Error: error building site: render: failed to render pages: render of "home" failed: "C:\_repos\github\hugo-forum\askme_site\themes\AskMe\layouts\index.html:65:19": execute of template failed: template: index.html:65:19: executing "index.html" at <partial "pagination.html" $paginator>: error calling partial: "C:\_repos\github\hugo-forum\askme_site\themes\AskMe\layouts\partials\pagination.html:8:20": execute of template failed: template: partials/pagination.html:8:20: executing "partials/pagination.html" at <.Page>: can't evaluate field Page in type *page.Pager
sorry i do not understand the error. Is it regarding the “themes” folder? Well, that folder is actually empty from beginning, even in original site containing Jekyll. I kept it as i did not know what to do with it. Does this help?
BTW, Chatgpt had told me to rename hugo.toml to config.toml to work in Hugo…is that correct?
don’t get it wrong, but I think you won’t get far with trying to convert that jekyll stuff to a proper hugo site without depper learning. Spend some minutes to read Requesting Help. There’s some mention about expectations…
…
The bottom line is, if you are unwilling to invest the time required to learn these things, then Hugo is not for you.
…
Take your time and learn - Chat GPT will give you code snippet but no solutions for Design and Concepts.
hugo is the preferred name for the main config (config is still supported for backward compatibility. the format can be yml, tomal or json - just as you like
Jeykyll is Jekyll and Hugo is Hugo - they differ at many places and in concepts.
So the answer is: you need to read a bunch of docs, guides, … Will be a hard going with ChatPGT and no idea about the Hugo concepts.
the called partial tries to access .Page on the passes $paginator. Tis does not exist. I already posted the link on pagination.
Permalink
you have the following code in many places fe. baseof.html line 88 looks like this is a rather fatal error and so the printed line number is from wrong partial
href="{{ if not .external }}{{ .Site.BaseURL }}/{{ end }}{{ .Permalink }}"
commented the call to the partial
combining these two makes no sense
.Site.baseURL is a complete URL
.Permalink is a complete URL
commented the complete generation(<a … /a>)
Defining the menus in a data file is not the easiest approach. You will have to do many things manually that hugo can do for you see Menus | Hugo.
Your access to the menu data file seems to be wrong
to be continued
With these two first errors commented we raise up the next bunch of error messages:
hugo
Start building sites …
hugo v0.134.3-5fb333b9f5ff4ec018f9d78910177d0bec1befb0+extended windows/amd64 BuildDate=2024-09-19T14:28:20Z VendorInfo=gohugoio
ERROR render of "page" failed: "C:\_repos\github\hugo-forum\askme_site\themes\AskMe\layouts\_default\baseof.html:15:62": execute of template failed: template: _default/single.html:15:62: executing "_default/single.html" at <strings>: can't evaluate field Join in type interface {}
ERROR render of "term" failed: "C:\_repos\github\hugo-forum\askme_site\themes\AskMe\layouts\_default\baseof.html:15:62": execute of template failed: template: taxonomy/category.html:15:62: executing "taxonomy/category.html" at <strings>: can't evaluate field Join in type interface {}
ERROR render of "taxonomy" failed: "C:\_repos\github\hugo-forum\askme_site\themes\AskMe\layouts\_default\baseof.html:15:62": execute of template failed: template: taxonomy/terms.html:15:62: executing "taxonomy/terms.html" at <strings>: can't evaluate field Join in type interface {}
Total in 26 ms
Error: error building site: render: failed to render pages: render of "page" failed: "C:\_repos\github\hugo-forum\askme_site\themes\AskMe\layouts\_default\baseof.html:15:62": execute of template failed: template: _default/single.html:15:62: executing "_default/single.html" at <strings>: can't evaluate field Join in type interface {}
Thanks. i had checked https://themes.gohugo.io/ but couldnt find a similar theme like the “Jekyll Affliates”, so thought of converting it if it was easy. I guess there is no easy way other than learn Jekyll and Hugo, then think of converting it.