Skip to content

Twitter Cards: add twitter:image, twitter:title and twitter:description #58

@matrixise

Description

@matrixise

Problem

layouts/partials/head.html:16-18 only declares twitter:card and twitter:site. Twitter falls back to the og:* tags, so it works — but only if the OG image exists (see #52), and it is more robust to declare the Twitter tags explicitly.

To do

  • Add:
<meta name="twitter:title" content="{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ .Title }}{{ end }}">
<meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{ .Site.Params.description }}{{ end }}">
{{ with .Site.Params.ogImage }}<meta name="twitter:image" content="{{ . | absURL }}">{{ end }}

Depends on #52.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpriority: mediumFix within 1 monthseoSearch engine optimisation

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions