-
Notifications
You must be signed in to change notification settings - Fork 305
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
add meta description for google lighthouse #121
base: master
Are you sure you want to change the base?
Conversation
c87c513
to
8b88860
Compare
Hi can we get this merged? @Track3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @shibumi
Sorry for the long wait, please resolve below and I will merge, thanks!
@@ -9,6 +9,7 @@ | |||
<meta name="theme-color" content="{{.}}"> | |||
<meta name="msapplication-TileColor" content="{{.}}"> | |||
{{- end }} | |||
<meta name="description" content="{{.Description | default .Site.Params.Description}}"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of putting this in baseof.html, it's better placing this inside layouts/partials/structured-data.html
.
As for code inside content attribute, I think we can refer to Hugo internal templates here:
https://github.com/gohugoio/hugo/blob/fc0f13b68451a09a6d6b4ce50c4217313b664176/tpl/tplimpl/embedded/templates/schema.html#L2
it covers more cases
{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, sorry for the late reply I do not work on my blog that often...
I checked your message and we are already impprting this schema.html template in our layouts/partials/structured-data.html:
{{- template "_internal/schema.html" . }}
{{- template "_internal/opengraph.html" . }}
{{- template "_internal/twitter_cards.html" . }}
Hence, I have no idea what you mean. The problem seem to be that the schema.html template from the _internall hugo library uses itemprop instead of name
in the meta tag... and that's why it doesn't get recognized, because itemprop seem to be for social media stuff only.
This adds a meta description to all websites for satisfying Google.
It also allows setting a "description" tag in every blog post for making it easier for Google to find these blog articles.
This is supposed to fix #119