Skip to content
This repository was archived by the owner on Jul 6, 2023. It is now read-only.
This repository was archived by the owner on Jul 6, 2023. It is now read-only.

How to get size of image? #194

@zacky1972

Description

@zacky1972

Facebook's share debugger said that og:image:width and og:image:height tags should be used with og:image tag.

So, I'd like to describe _layout.slime as follows, but of course, this does not work:

doctype html
html
  head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# article: http://ogp.me/ns/article#"
    title TITLE
    meta charset="UTF-8"
    meta name="viewport" content="width=device-width, initial-scale=1.0"
    = link_to_css @env, "css/theme.css", media: "all"
    meta name="twitter:card" content="summary"
    meta name="twitter:site:id" content="@twitter_id"
    meta name="twitter:creator:id" content="@twitter_id"
    meta name="twitter:title" content=@title
    meta name="twitter:description" content=@description
    meta property="og:title" content=@title
    meta property="og:site_name" content="TITLE"
    meta property="og:type" content="article"
    meta property="og:description" content=@description
    meta property="og:image" content=@image
    meta property="og:image:width" content=@image_width
    meta property="og:image:height" content=@image_height
  body
    = @children

How should I describe this instead of using @image_width and @image_height?

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