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

Added new bookmark card #11024

Merged
merged 14 commits into from Aug 27, 2019
Merged

Conversation

rishabhgrg
Copy link
Contributor

@rishabhgrg rishabhgrg commented Aug 15, 2019

requires TryGhost/Admin#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:
      {
          "url": "...",
          "type": "bookmark",
          "metadata": {
              "url": "...",
              "title": "...",
              "description": "...",
              "author": "...",
              "publisher": "...",
              "thumbnail": "...",
              "icon": "..."
          }
      }
  • adds a bookmark card which generates output for the bookmark card:
    <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

peterzimon added a commit to rishabhgrg/Casper that referenced this pull request Aug 26, 2019
refs: TryGhost/Ghost#11024
- added support for Bookmark card for Casper theme
@rishabhgrg rishabhgrg changed the title [WIP] Added new bookmark card Added new bookmark card Aug 27, 2019
@rishabhgrg rishabhgrg marked this pull request as ready for review August 27, 2019 08:32
@kevinansfield kevinansfield merged commit c2aa620 into TryGhost:master Aug 27, 2019
kevinansfield pushed a commit to TryGhost/Admin that referenced this pull request Aug 27, 2019
#1293)

requires TryGhost/Ghost#11024

With the bookmark card you can present links in a much richer format, similar to Twitter cards. If the URL points to a page with right meta information it can show the page title, excerpt, author, publisher and even a preview image.

Bookmark cards can be created in two ways:

1. pasting a link as the first thing in blank paragraph - we'll check to see if we can create an embed, if we can't then we'll create a bookmark card instead
2. manually selecting the bookmark card from the (+) menu or by typing "/bookmark<kbd>Enter</kbd>" or "/bookmark {url}<kbd>Enter</kbd>" for short (you might want to do this if you want the bookmark version instead of a full embed)

Pressing <kbd>Ctrl/Cmd+Z</kbd> after pasting will convert the bookmark card back to a link if that's preferred, alternatively a URL can be pasted with <kbd>Ctrl/Cmd+Shift+V</kbd> to avoid any automatic transformation to an embed/bookmark.

---

- adds "bookmark" card that functions similarly to the embed card
- if the oembed API request returns `type: "bookmark"` then the metadata is used to create a bookmark card
naz added a commit to naz/gscan that referenced this pull request Sep 19, 2019
TryGhost/Ghost#11024

- 10 bookmark card rules have landed in Ghost as of 2.30.0 release, so they need to be checked for in v2 onwards
naz added a commit to naz/gscan that referenced this pull request Sep 19, 2019
TryGhost/Ghost#11024

- 10 bookmark card rules have landed in Ghost as of 2.30.0 release, so they need to be checked for in v2 onwards
naz added a commit to naz/gscan that referenced this pull request Sep 19, 2019
TryGhost/Ghost#11024

- 10 bookmark card rules have landed in Ghost as of 2.30.0 release, so they need to be checked for in v2 onwards
naz added a commit to TryGhost/gscan that referenced this pull request Sep 19, 2019
ref TryGhost/Ghost#11024

- 10 bookmark card rules have landed in Ghost as of 2.30.0 release, so they need to be checked for in v2 onwards
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants