Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

structured properties should be exposed as python dicts #2

Open
chason opened this issue Aug 3, 2018 · 0 comments
Open

structured properties should be exposed as python dicts #2

chason opened this issue Aug 3, 2018 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@chason
Copy link
Owner

chason commented Aug 3, 2018

Structured OGP properties (i.e. image) should be represented with a similar structure in the class. For example:

<meta property="og:image" content="http://example.com/ogp.jpg" />
<meta property="og:image:secure_url" content="https://secure.example.com/ogp.jpg" />
<meta property="og:image:type" content="image/jpeg" />
<meta property="og:image:width" content="400" />
<meta property="og:image:height" content="300" />
<meta property="og:image:alt" content="A shiny red apple with a bite taken out" />

Should probably look something like:

{
  "url": "http://example.com/ogp.jpg",
  "secure_url": "https://secure.example.com/ogp.jpg",
  "type": "image/jpeg",
  "width": 400,
  "height": 300,
  "alt": "A shiny red apple with a bite taken out"
}

Note that the image property is converted into url. This is because og:image and 'og:image:url` are synonyms in OGP.

The structure above and how it is presented in the OGP class are suggestions. If you have a more creative solution with significant benefits, feel free to try it out.

@chason chason added enhancement New feature or request help wanted Extra attention is needed labels Aug 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant