ga-hugo-theme icon indicating copy to clipboard operation
ga-hugo-theme copied to clipboard

Trying to follow the tutorial throws "fail to render" when creating a new page.

Open ILiterallyCannot opened this issue 2 years ago • 6 comments

When a user tries to make a page (or any page for that matter), the rendering will fail with the following error

ERROR 2022/03/30 11:19:24 Failed to render pages: render of "home" failed: "/Users/path/to/test/site/themes/ga-hugo-theme/layouts/_default/list.html:14:31": execute of template failed: template: _default/list.html:14:31: executing "_default/list.html" at <.URL>: can't evaluate field URL in type page.Page

Steps to reproduce: create new hugo site, clone a theme, and attempt to add a page as the tutorial suggests.

ILiterallyCannot avatar Mar 30 '22 08:03 ILiterallyCannot

You may have a too recent version of hugo. The site will render with some warnings with an older version of hugo.

I don't have all the versions of hugo built here but at least hugo v0.84.0 works ok for this example. 0.94.0 or the most recent versions of hugo will not work.

flowerbug avatar Apr 01 '22 21:04 flowerbug

Okay! That makes sense. Thanks for the comment :) I will try this out

ILiterallyCannot avatar Apr 04 '22 10:04 ILiterallyCannot

Same issue here. Remove .URL can avoid compile error(but lose some convenience).

-                    <a href="{{.URL}}">{{.Title}}</a>
+                    <a href="">{{.Title}}</a>

longfeiss avatar Apr 09 '22 02:04 longfeiss

Replace {{.URL}} with {{.RelPermalink}} and it works just fine.

zszep avatar May 16 '22 07:05 zszep

Thank you for your response!

Kind regards,

Corey Johnson +358445001976

On Mon, May 16, 2022, 10:22 Željko Szep @.***> wrote:

Replace {{.URL}} with {{.RelPermalink}} and it works just fine.

— Reply to this email directly, view it on GitHub https://github.com/giraffeacademy/ga-hugo-theme/issues/6#issuecomment-1127318110, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALLT2JKVCZC7ZSMEKWRKQFDVKHZUZANCNFSM5SBDQR2Q . You are receiving this because you authored the thread.Message ID: @.***>

ILiterallyCannot avatar May 16 '22 07:05 ILiterallyCannot

Replace {{.URL}} with {{.RelPermalink}} and it works just fine.

Thank you. This resolved partly. However, it now provides a Dir1s link rather than showing b.md.. I tried with Permalink and seems like a temporary fix. I still dont get all the *.md in one page like the tutorial.

sambidwasti avatar Aug 03 '22 15:08 sambidwasti