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

add meta description for google lighthouse #121

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

shibumi
Copy link

@shibumi shibumi commented Feb 23, 2020

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

@shibumi
Copy link
Author

shibumi commented May 24, 2020

Hi can we get this merged? @Track3

Copy link
Owner

@Track3 Track3 left a 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}}">
Copy link
Owner

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 -}}

Copy link
Author

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.

olbrew added a commit to olbrew/hermit that referenced this pull request Jan 28, 2022
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

Successfully merging this pull request may close these issues.

meta description doesn't satisfy Google lighthouse
2 participants