Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions archetypes/default.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
draft: true
description:
comments: false
images:
---
Expand Down
1 change: 1 addition & 0 deletions archetypes/posts.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
draft: true
description:
toc: false
images:
tags:
Expand Down
1 change: 1 addition & 0 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -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.

{{- partial "structured-data.html" . }}
{{- partial "favicons.html" }}
<title>{{.Title}}</title>
Expand Down