Skip to content

Social media image preview #140

@wipfli

Description

@wipfli

When posting links to news articles on social media, the platforms often show a post preview image. But for us this is always the same image. Would be cool if we could have a different image for each article. In the past I sometimes deleted the default image but linkedin basically does not show posts without an image... So for now I past the image manually but would be cool if we could set dynamically what goes into the header. The relevant section is probably this one:

<meta property="og:image" content="/img/share-image.png" />
<meta property="og:image:width" content="1024" />
<meta property="og:image:height" content="512" />
<meta property="og:image:alt" content="MapLibre" />
<meta property="og:title" content="{{ .Title }}" />
<meta property="og:description" content="{{ .Params.description }}" />
<meta property="og:url" content="{{ .Permalink | absURL }}" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@maplibre" />
<meta name="twitter:creator" content="@maplibre" />
<meta name="twitter:title" content="{{ .Title }}" />
<meta name="twitter:description" content="{{ .Params.description }}" />
<meta name="twitter:image:src" content="/img/share-image.png" />
<meta name="twitter:image:alt" content="MapLibre" />

@louwers @maxammann do you know how we could do this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions