mrmierzejewski / hugo-theme-console

A minimal, responsive and light theme for Hugo inspired by Linux console.
MIT License
393 stars 118 forks source link

bugfixed #6

Closed litao3rd closed 4 years ago

litao3rd commented 4 years ago

I am using hugo with version Hugo Static Site Generator v0.72.0-DEV/extended linux/amd64 BuildDate: unknown

I clone the latest console theme into my site project. After that I create a post with command hugo new posts/hello-world.md, then I compile my project with command hugo -D without any modification of newly create post. I got error like this:

Error: Error building site: failed to render pages: render of "home" failed: "/path/to/myblog/site/project/themes/hugo-theme-console/layouts/index.html:14:22": execute of template failed: template: index.html:14:22: executing "main" at <(where .Pages ".Params.private" "!=" true) sort .Data.Pages "Date" "desc">: can't give argument to non-function where .Pages ".Params.private" "!=" true

I don't know why I got this error and I am not familiar with hugo template DSL. Luckily after this modification I got all errors gone.

mrmierzejewski commented 4 years ago

I checked your changes with Hugo v0.71.0 and it doesn't work:

ERROR 2020/05/27 19:53:57 Failed to render pages: render of "home" failed: "/themes/hugo-theme-console/layouts/index.html:14:22": execute of template failed: template: index.html:14:22: executing "main" at <sort (where .Pages ".Params.private" "!=" true) .Data.Pages "Date" "desc">: error calling sort: Pages(2) isn't a field of struct type page.Page

Strange.

litao3rd commented 4 years ago

so strange. Have you check it under my version of hugo? Or maybe I should not use DEV version of hugo. I will check it with stable version later.

GuoRan18 commented 4 years ago

Error: Error building site: failed to render pages: render of "home" failed: "/root/RemoteWorking/blog/themes/hugo-theme-console/layouts/index.html:14:22": execute of template failed: template: index.html:14:22: executing "main" at <(where .Pages ".Params.private" "!=" true) sort .Data.Pages "Date" "desc">: can't give argument to non-function where .Pages ".Params.private" "!=" true

mrmierzejewski commented 4 years ago

@chensu92 What Hugo version are you using?

GuoRan18 commented 4 years ago

hugo0.71.1

------------------ 原始邮件 ------------------ 发件人: "Marcin Mierzejewski"<notifications@github.com>; 发送时间: 2020年5月28日(星期四) 下午4:29 收件人: "mrmierzejewski/hugo-theme-console"<hugo-theme-console@noreply.github.com>; 抄送: "ゆ琛苏""<chen.ssj@qq.com>; "Mention"<mention@noreply.github.com>; 主题: Re: [mrmierzejewski/hugo-theme-console] bugfixed (#6)

@chensu92 What Hugo version are you using?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

mrmierzejewski commented 4 years ago

@litao3rd, @chensu92 problem fixed.