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

reflect.Value.Type #6

Closed
aaronmehar opened this issue Apr 19, 2016 · 7 comments
Closed

reflect.Value.Type #6

aaronmehar opened this issue Apr 19, 2016 · 7 comments

Comments

@aaronmehar
Copy link
Contributor

Hi!

Love the theme, and your port.. I am new to hugo, and I get the below when loading up the site, everything seems to work fine, and I have little XP with GO.. I checked out share.html but it all looks valid - any ideas?

$ hugo server watch -t hasper
ERROR: 2016/04/19 reflect: call of reflect.Value.Type on zero Value in theme/partials/share.html
ERROR: 2016/04/19 reflect: call of reflect.Value.Type on zero Value in theme/partials/share.html
ERROR: 2016/04/19 reflect: call of reflect.Value.Type on zero Value in theme/partials/share.html
ERROR: 2016/04/19 reflect: call of reflect.Value.Type on zero Value in theme/partials/share.html
ERROR: 2016/04/19 reflect: call of reflect.Value.Type on zero Value in theme/partials/share.html
ERROR: 2016/04/19 reflect: call of reflect.Value.Type on zero Value in theme/partials/share.html
ERROR: 2016/04/19 reflect: call of reflect.Value.Type on zero Value in theme/partials/share.html
ERROR: 2016/04/19 reflect: call of reflect.Value.Type on zero Value in theme/partials/share.html
ERROR: 2016/04/19 reflect: call of reflect.Value.Type on zero Value in theme/partials/share.html
ERROR: 2016/04/19 reflect: call of reflect.Value.Type on zero Value in theme/partials/share.html
ERROR: 2016/04/19 reflect: call of reflect.Value.Type on zero Value in theme/partials/share.html
ERROR: 2016/04/19 reflect: call of reflect.Value.Type on zero Value in theme/partials/share.html
ERROR: 2016/04/19 reflect: call of reflect.Value.Type on zero Value in theme/partials/share.html
ERROR: 2016/04/19 reflect: call of reflect.Value.Type on zero Value in theme/partials/share.html
ERROR: 2016/04/19 reflect: call of reflect.Value.Type on zero Value in theme/partials/share.html
0 draft content
0 future content
15 pages created
27 paginator pages created
21 tags created
0 categories created
in 61 ms
Watching for changes in /redacted/fullpath/{data,content,layouts,static,themes}
Serving pages from memory
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop
@dencold
Copy link
Owner

dencold commented Apr 20, 2016

Hey @aaronmehar thanks for bringing this to my attention! I haven't seen this in my local build, here is what my output looks like for the same command run:

$ hugo server watch -t hasper
0 draft content
0 future content
41 pages created
19 paginator pages created
1 tags created
0 categories created
in 97 ms
Watching for changes in also-redacted/{content,layouts,static,themes}
Serving pages from memory
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop

I will do some more digging tomorrow when I will have more time.

Could you do me a favor and send me the output of hugo version? That will also help.

Thanks! Glad you are enjoying/using the theme.

@aaronmehar
Copy link
Contributor Author

Running the latest version using brew.

$ hugo version
Hugo Static Site Generator v0.15 BuildDate: 2015-11-26T06:29:07Z

I think its related to the config.toml file, will check and test tomorrow and confirm

@dencold
Copy link
Owner

dencold commented Apr 20, 2016

Okay, great, good to know we are on the same version.

If you wouldn't mind posting your config.toml, that will help me check from my side as well. (feel free to redact where necessary :)

Thanks again for reporting!

@dencold
Copy link
Owner

dencold commented Apr 21, 2016

@aaronmehar I have this figured out. Awhile back I made commit b334fed which enabled share buttons to be user-configurable. Prior to this, you always had every share button at the bottom of the post in detail view, whether you liked it or not.

However, it looks like I've introduced a regression with this change. I'm guessing you don't have a configuration defined for shares in your config.tml. For example, here's what I have in my config.yaml (I prefer the yaml format, but should be analogous to toml)

  shares:
    twitter: true
    facebook: true
    google-plus: false

When you don't have anything defined for shares the code in the the share.html Go template fails:

if index .Site.Params.shares "twitter"

...because there is nothing to index into.

I'll have a fix in place shortly for this. Thanks so much for bringing this to my attention. Big help!!!

@dencold
Copy link
Owner

dencold commented Apr 21, 2016

@aaronmehar this should be fixed for you now. I've updated the logic so that unset sharing config does not produce the zero value errors. You should be able to pull the latest and see the warnings go away.

However, the default state will have sharing disabled. If you'd like to have sharing links appear on posts. Add this to your site configuration (under the params section):

sharing:
  twitter: true
  facebook: true
  google-plus: true
  pinterest: true

Of course, you're free to disable any of those by flipping the boolean to false.

Let me know if you get stuck, or notice anything else!

@aaronmehar
Copy link
Contributor Author

@dencold I pulled down those changes and its working perfectly as expected.. Thank so much for being so responsive and providing such a quick fix!

@dencold
Copy link
Owner

dencold commented Apr 21, 2016

No problem @aaronmehar! Apologies you ran into this in the first place. I wasn't expecting anyone outside of myself to be using this theme as I haven't yet posted it on the hugo site. Thanks for making use of it! Hope it comes in handy ;)

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

No branches or pull requests

2 participants