Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix layouts of lists and content #5

Merged
merged 1 commit into from
Nov 7, 2016
Merged

Fix layouts of lists and content #5

merged 1 commit into from
Nov 7, 2016

Conversation

sergobot
Copy link
Contributor

@sergobot sergobot commented Nov 5, 2016

Hugo v0.17 was giving errors like this:
ERROR: 2016/11/05 20:32:30 template.go:132: template: theme/partials/content.html:8:40: executing "theme/partials/content.html" at <.Site.Params.dateFor...>: invalid value; expected string in theme/partials/content.html

Now there are no errors and hugo-goa-demo works properly after this commit. Also, it seems to be solution for #4.

Hugo v0.17 was giving errors like this:
ERROR: 2016/11/05 20:32:30 template.go:132: template: theme/partials/content.html:8:40: executing "theme/partials/content.html" at <.Site.Params.dateFor...>: invalid value; expected string in theme/partials/content.html

Now there are no error and hugo-goa-demo works properly after this commit.
@shenoydotme
Copy link
Owner

Thank you @sergobot

@shenoydotme shenoydotme merged commit b0ef3c8 into shenoydotme:master Nov 7, 2016
@shenoydotme shenoydotme added the bug label Nov 7, 2016
@shenoydotme shenoydotme self-assigned this Nov 7, 2016
@shenoydotme
Copy link
Owner

@sergobot, this has not fixed the issue. When I tested it locally, the string .SITE.PARAMS.DATEFORMAT replaces the date. The issue is most probably something with the users config. I'd have to revert this change for now since it is breaking my site. I'll ask the user for more info before applying this patch.

@shenoydotme
Copy link
Owner

@sergobot The user was missing .dateFormat within their config.toml.

@sergobot
Copy link
Contributor Author

sergobot commented Nov 8, 2016

@shenoybr,
Seems quite strange to me, as hugo-goa-demo has the following in its config.toml:

dateFormat = "Jan 2, 2006"

but it didn't work fine before my fix. I have uploaded my screenshots to imgur.

By the way, without the fix hugo v0.17 gives errors like the one I copied to PR. And current master branch of hugo says your templates are incorrect:

ERROR: 2016/11/08 06:46:54 general.go:236: theme/partials/li.html is an incomplete or empty template
ERROR: 2016/11/08 06:46:54 general.go:236: theme/partials/content.html is an incomplete or empty template

@shenoydotme
Copy link
Owner

shenoydotme commented Nov 8, 2016

Could you tell me which version of Golang you are using? I tested this on both go 1.6, 1.7.1 and hugo v0.16 and v0.17.

The fix you made is incorrect, because it doesn't display the date, and rather displays the string .SITE.PARAMS.DATEFORMAT. The objective is to display the date in the format 'Jan 2, 2006', or other.

Would there be anything else in the config.toml that is missing? I tested hugo-goa-demo on various platforms, it also works on themes.hugo.io as in here.

@sergobot
Copy link
Contributor Author

sergobot commented Nov 9, 2016

@shenoybr
Thank you, now I got it. I didn't notice that .SITE.PARAMS.DATEFORMAT date when making this PR, sorry. But, at least, my fix made hugo-goa-demo working (more on that below).

$ go version
go version go1.7.3 linux/amd64

I have tested hugo-goa-demo with some different hugo versions and here are the results. Really weird results...

Without fix

  • hugo v0.16, self-built
    hugo_0 16_without_fix
  • hugo v0.17, self-built
    hugo_0 17_without_fix
  • hugo v0.18-DEV (master), self-built
    hugo_master_without_fix

With fix

  • hugo v0.16, self-built
    hugo_0 16_with_fix
  • hugo v0.17, self-built
    hugo_0 17_with_fix
  • hugo v0.18-DEV (master), self-built
    hugo_master_with_fix

The weird thing

Disappointed by these results, I have also tried building the site with pre-compiled hugo from https://github.com/spf13/hugo/releases. Screenshots going below are made without my fix, since the fix doesn't make any difference compared to self-built versions of hugo.

  • hugo v0.16, release
    hugo_0 16_release_without_fix
  • hugo v0.17, self-built
    hugo_0 17_release_without_fix

So, actual explanation seems to be one of
a) Something wrong with my environment
b) Hugo requires some additional flags when built
c) Bug in go 1.7.3 (Not sure, since I didn't try build hugo with 1.7.1, for example)

@sergobot
Copy link
Contributor Author

sergobot commented Nov 9, 2016

Now I have tried building hugo v0.17 with go 1.7.1 and there is no difference
hugo_0 17_without_fix_go1 7 1

Also, I noticed that Erlich's photo isn't shown when running self-built hugo, and, obviously, is shown when running pre-built hugo.
No headshot

@shenoydotme
Copy link
Owner

@sergobot Thank you for this detailed investigation into the issue. I agree that it does look like it might have something to do with self-built hugo or the environment it is running in. I'll try and run it this weekend to understand why it could happen.

@sergobot
Copy link
Contributor Author

sergobot commented Nov 13, 2016

@shenoybr Hi, how is your investigation going?

@sergobot
Copy link
Contributor Author

Okay, I have fixed it. Check out #10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants