-
Notifications
You must be signed in to change notification settings - Fork 197
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
Wrap meta information in <HEAD> tags #194
Conversation
I wonder, can you put the head tag inside the customization file? This looks like breaking change for everyone who already does that. |
@zjedi Okay, so are you asking me to put it in layouts/partials/head.html? I'm fine with doing that if you think it is best. I don't know how other people do it. |
@welcome-me I don't know for sure how other people use it either :) I'm just trying to think critically about what could break. From theoretical point of view, it's better to have the tag being customized in the customization file, since you may want to customize also that tag's attributes. That won't apply to Just by checking the demo page's source, there IS proper Your PR looks logical, but how come the demo does have the head? Won't adding the |
Bear with me, I'll check this out at the weekend. |
@welcome-me That is truly confusing because I do see head tag there. I can't see an explanation for getting different results here. I'm checking https://zjedi.github.io/hugo-scroll/ via desktop Chrome |
I expect that the browser console is showing that there because those tags are supposed to be in the head tag. If you right click the page and click view the source, I think it will show that the head tag is not in the output we're generating for the browser. |
Aha, I am using inspect element. So the browser gives two different results based on inspection method. I still don't get it :) Do browsers just figure out there should be wrapping head tag when inspect element is used? |
Based on the below Stack Overflow answer and your experience with your browser inspector, it looks like the page is correctly parsed without the head tags. In fact, it looks like that's part of the HTML5 spec! However, it is also true that implicit HEAD tags are required for verifying site ownership with Google. I don't know why we wouldn't want a three line change that increases compatibility with website analysis tools. Does that make sense? Is it necessary to write HEAD, BODY and HTML tags? - Stack Overflow |
I have a site that uses this theme, and I wanted to verify my ownership of it so I could use Google's search console. Google supplied a custom
meta
tag so I put it intolayouts/partials/custom_head.html
; however, I still failed Google's validation. Then, I realized that the output oflayouts/partials/head.html
is not wrapped in tags.Once I added wrapped the output of head.html in
<head>
and</head>
, I was able to verify my site.