0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00
ghost/core/server/api/canary
Rishabh Garg c2aa62083c Added support for bookmark card (#11024)
requires https://github.com/TryGhost/Ghost-Admin/pull/1293

- updates `oembed` endpoint behaviour
  - if an oembed provider is not found then we use `metascraper` to populate a metadata object
  - when metadata is returned rather than an oembed response the payload will look like this:
    ```json
    {
        "url": "...",
        "type": "bookmark",
        "metadata": {
            "url": "...",
            "title": "...",
            "description": "...",
            "author": "...",
            "publisher": "...",
            "thumbnail": "...",
            "icon": "..."
        }
    }
    ```
- adds a `bookmark` card which generates output for the bookmark card:
  ```html
  <figure class="kg-card kg-bookmark-card">
    <a href="[URL]" class="kg-bookmark-container">
      <div class="kg-bookmark-content">
        <div class="kg-bookmark-title">[TITLE]</div>
        <div class="kg-bookmark-description">[DESCRIPTION]</div>
        <div class="kg-bookmark-metadata">
          <img src="[ICON]" class="kg-bookmark-icon">
          <span class="kg-bookmark-author">[AUTHOR]</span>
          <span class="kg-bookmark-publisher">[PUBLISHER]</span>
        </div>
      </div>
      <div class="kg-bookmark-thumbnail">
        <img src="[THUMBNAIL]">
      </div>
    </a>
  </figure>
  ```
  - if a particular bit of data does not exist then the associated html element will not be present
2019-08-27 15:01:02 +01:00
..
utils Revert post.page->post.type handling 2019-08-19 12:02:14 +01:00
actions.js Updated canary actions endpoint 2019-08-14 17:40:36 +08:00
authentication.js
authors-public.js
config.js
db.js
images.js
index.js
integrations.js
invites.js
mail.js
members.js
notifications.js
oembed.js Added support for bookmark card (#11024) 2019-08-27 15:01:02 +01:00
pages-public.js
pages.js
posts-public.js
posts.js
preview.js
redirects.js
roles.js
schedules.js
session.js
settings-public.js
settings.js
site.js
slack.js
slugs.js
subscribers.js
tags-public.js
tags.js
themes.js
users.js
webhooks.js