Skip to content

OpenGraph image width and height tags missing in _internal/opengraph.html template #13478

Open
@dansailer

Description

@dansailer

Meta documentation of open graph suggests to always use the og:image:width and og:image:height tags.

Use og:image:width and og:image:height Open Graph tags:
Using these tags will specify the image dimensions to the crawler
so that it can render the image immediately without having to asynchronously
download and process it.

Is there a reason, why they are missing in tpl/tplimpl/embedded/templates/opengraph.html?

Something a long those lines, would solve the missing card previews in WhatsApp, etc.

{{- with partial "_funcs/get-page-images" . }}
  {{- range . | first 6 }}
    <meta property="og:image" content="{{ .Permalink }}">
    {{ with $.Page.Resources.Get .Image }}
      <meta property="og:image:width" content="{{ .Width }}">
      <meta property="og:image:height" content="{{ .Height }}">
    {{ end }}
  {{- end }}
{{- end }}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions