add meta description for google lighthouse#121
Conversation
c87c513 to
8b88860
Compare
|
Hi can we get this merged? @Track3 |
| <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.
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.
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