kaapiandcode / hugo-goa

Simple Minimalistic Theme for Hugo
https://kaapiandcode.github.io/hugo-goa-demo/
MIT License
264 stars 128 forks source link

Error building site: failed to render pages: render of "home" failed #72

Closed sbuvaneshkumar closed 3 years ago

sbuvaneshkumar commented 5 years ago

After adding theme, I am getting following error. I have tried with brand new site, without any content, facing the same issue.

➜  quickstart git:(master) ✗ hugo server -D          
Building sites … WARN 2019/09/19 17:58:56 Page's .RSSLink is deprecated and will be removed in a future release. Use the Output Format's link, e.g. something like: 
    {{ with .OutputFormats.Get "RSS" }}{{ .RelPermalink }}{{ end }}.
Total in 7 ms
Error: Error building site: failed to render pages: render of "home" failed: "/root/quickstart/themes/hugo-goa/layouts/index.html:2:11": execute of template failed: template: index.html:9:3: executing "index.html" at <partial "main_menu.html" .>: error calling partial: "/root/quickstart/themes/hugo-goa/layouts/partials/main_menu.html:2:11": execute of template failed: template: partials/main_menu.html:2:11: executing "partials/main_menu.html" at <sort .Site.Menus.main>: error calling sort: sequence must be provided

➜  quickstart git:(master) ✗ hugo version   
Hugo Static Site Generator v0.58.2-253E5FDC linux/amd64 BuildDate: 2019-09-13T08:05:59Z

➜  quickstart git:(master) ✗ cat config.toml 
baseURL = "http://example.org/"
languageCode = "en-us"
title = "My New Hugo Site"
theme = "hugo-goa"

➜  quickstart git:(master) ✗ ll themes/hugo-goa 
total 20K
drwxr-xr-x. 2 root root   24 Sep 19 17:57 archetypes
drwxr-xr-x. 6 root root  131 Sep 19 17:57 exampleSite
drwxr-xr-x. 2 root root   42 Sep 19 17:57 images
drwxr-xr-x. 4 root root   72 Sep 19 17:57 layouts
-rw-r--r--. 1 root root 1.1K Sep 19 17:57 LICENSE
-rw-r--r--. 1 root root  12K Sep 19 17:57 README.md
drwxr-xr-x. 5 root root  217 Sep 19 17:57 static
-rw-r--r--. 1 root root  480 Sep 19 17:57 theme.toml
connor11528 commented 4 years ago

I am getting the same error. @sbuvaneshkumar did you find a solution or workaround for this?

sbuvaneshkumar commented 4 years ago

@connor11528 Unfortunately no, still I don't find any workaround or solution.

pferretti commented 4 years ago

Hi @sbuvaneshkumar @connor11528 I think that you must specify at least a main menu entry in config.toml. For example:

[[menu.main]] name = "about" identifier = "about" weight = 200 url = "/about/"

connor11528 commented 4 years ago

Okay thank you @pferretti

I added this and am getting an error on the command line. For all my files in content/posts/ directory I have the date saved like: date: "2017-11-26" any ideas what more I need to improve?

$ hugo server -D
Building sites … WARN 2020/01/12 18:11:09 Page.RSSLink is deprecated and will be removed in a future release. Use the Output Format's link, e.g. something like:
    {{ with .OutputFormats.Get "RSS" }}{{ .RelPermalink }}{{ end }}
ERROR 2020/01/12 18:11:09 render of "section" failed: "/Users/connorleech/Projects/connorleech.info/themes/hugo-goa/layouts/_default/list.html:7:55": execute of template failed: template: _default/list.html:3:3: executing "_default/list.html" at <partial "li.html" .>: error calling partial: "/Users/connorleech/Projects/connorleech.info/themes/hugo-goa/layouts/partials/li.html:7:55": execute of template failed: template: partials/li.html:7:55: executing "partials/li.html" at <.Site.Params.dateformat>: invalid value; expected string
ERROR 2020/01/12 18:11:09 render of "page" failed: "/Users/connorleech/Projects/connorleech.info/themes/hugo-goa/layouts/_default/single.html:8:67": execute of template failed: template: _default/single.html:3:3: executing "_default/single.html" at <partial "content.html" .>: error calling partial: "/Users/connorleech/Projects/connorleech.info/themes/hugo-goa/layouts/partials/content.html:8:67": execute of template failed: template: partials/content.html:8:67: executing "partials/content.html" at <.Site.Params.dateformat>: invalid value; expected string
ERROR 2020/01/12 18:11:09 render of "page" failed: "/Users/connorleech/Projects/connorleech.info/themes/hugo-goa/layouts/_default/single.html:8:67": execute of template failed: template: _default/single.html:3:3: executing "_default/single.html" at <partial "content.html" .>: error calling partial: "/Users/connorleech/Projects/connorleech.info/themes/hugo-goa/layouts/partials/content.html:8:67": execute of template failed: template: partials/content.html:8:67: executing "partials/content.html" at <.Site.Params.dateformat>: invalid value; expected string
ERROR 2020/01/12 18:11:09 render of "page" failed: "/Users/connorleech/Projects/connorleech.info/themes/hugo-goa/layouts/_default/single.html:8:67": execute of template failed: template: _default/single.html:3:3: executing "_default/single.html" at <partial "content.html" .>: error calling partial: "/Users/connorleech/Projects/connorleech.info/themes/hugo-goa/layouts/partials/content.html:8:67": execute of template failed: template: partials/content.html:8:67: executing "partials/content.html" at <.Site.Params.dateformat>: invalid value; expected string
Built in 74 ms
Error: Error building site: failed to render pages: render of "page" failed: "/Users/connorleech/Projects/connorleech.info/themes/hugo-goa/layouts/_default/single.html:8:67": execute of template failed: template: _default/single.html:3:3: executing "_default/single.html" at <partial "content.html" .>: error calling partial: "/Users/connorleech/Projects/connorleech.info/themes/hugo-goa/layouts/partials/content.html:8:67": execute of template failed: template: partials/content.html:8:67: executing "partials/content.html" at <.Site.Params.dateformat>: invalid value; expected string
connor11528 commented 4 years ago

Okay nvm, I think I was just missing some configuration options. I added the config and everything is working now. I believe this issue can be closed out

Based config from the exampleSite (doh)

## Basic Configuration

baseurl = "https://shenoybr.github.io/hugo-goa-demo/"
builddrafts = false
canonifyurls = false
languageCode = "en-US"

contentdir = "content"
layoutdir = "layouts"
publishdir = "public"

author = "Erlich Bachman"
title = "Erlich Bachman"

theme = "hugo-goa"

## Hugo Built-in Features
disqusShortname = "https-shenoybr-github-io-hugo-goa-demo" # Comment out to disable Disqus.
googleAnalytics = "XYZ"
enableRobotsTXT = true

## Site Settings
[params]
author = "Erlich Bachman"
intro = "Startup Guru Extraordinaire"
description = "Now @Pied Piper. Previously @Hacker Hostel, @Bachmanity and @Aviato. <br/> \"What is F times 5? It's Fleventy-five.\""
authorimage = "headshot.jpg"
dateformat = "Jan 2, 2006"

## Site Meta Settings
[params.meta]
description = "Simple minimalist theme"
keywords = "minimalist,blog,goa,hugo,developer"

## Social Accounts
[params.social]
github = "<username>"
instagram = "<username>"
xing = "<username>"
linkedin = "<username>"
twitter = "<username>"
facebook = "<username>"
google = "<username>"
googlescholar = "<account_id>"
stackoverflow = "<username>"
lastfm = "<username>"
goodreads = "<username>"
gitlab = "<username>"
bitbucket = "<username>"
fivehundredpx = "<username>"
flickr = "<username>"
foursquare = "<username>"
hackernews = "<username>"
kickstarter = "<username>"
patreon = "<username>"
pintrest = "<username>"
steam = "<username>"
reddit = "<username>"
snapchat = "<username>"
youtube = "<channelid>"
keybase = "<username>"
twitch = "<username>"
soundcloud = "<username>"
tumblr = "<username>"
strava = "<username>"
skype = "<username>"
telegram = "<username>"
whatsapp = "<username>"
email = "you@example.com"
pgp = "<key_fingerprint>"

## Extras
[params.extra]
copyright = "© 2016. Erlich Bachman. [Some Rights Reserved](http://creativecommons.org/licenses/by/3.0/)."
poweredby = true
highlightjs = true
socialmarkup = true
toc = true
displayrssicon = true

## Main Menu
[[menu.main]]
    name = "blog"
    weight = 100
    identifier = "blog"
    url = "/blog/"
[[menu.main]]
    name = "about"
    identifier = "about"
    weight = 200
    url = "/about/"
[[menu.main]]
    name = "coderag"
    identifier = "coderag"
    weight = 300
    url = "/coderag/"
BackMountainDevil commented 3 years ago

[SOLVED] Hugo –minify: failed to render pages

Ayush23Dash commented 3 years ago

Hi, I am still unable to get solution of this. Can anyone please help me out??

mubashirjamali101 commented 3 years ago

Yeah me too, above solutions didn't work.

austinschrader commented 3 years ago

@Ayush23Dash @mubashirjamali101 I had this exact issue and it was in the config.toml.

In the theme 'Blonde', there's an exampleSite. I started copying and pasting the exampleSite files into mine, and finally when I got to config.toml the hugo server started running.

Try and find an exampleSite folder in your theme, or download one that does.

Philip-Valentino commented 2 years ago

I had the same issue, here is how I solved it:

Step 1: Open config.yaml in your website project in RStudio

Step 2:

Go to the last line in that script in RStudio and type in this (see below) and save it:

security: funcs: getenv:

duanziheng commented 2 years ago

I had the same issue, here is how I solved it:

Step 1: Open config.yaml in your website project in RStudio

Step 2:

Go to the last line in that script in RStudio and type in this (see below) and save it:

security: funcs: getenv: - ^HUGO - ^WC

don't know why but it really works!

krischik commented 6 months ago

I have the same problem with an existing site which worked before. Very frustrating. Will there ever be a proper fix?

kaapiandcode commented 5 months ago

@krischik Can you create a new issue detailing the problem you're facing with steps to reproduce or code / repo that I can use to investigate your problem?