Ghost/ghost/admin/app/components/gh-post-bookmark.hbs
Kevin Ansfield 473831ac2b Added image fallback and site icon/title to <GhPostBookmark> (#2401)
no issue

- adds `{{get-setting "key"}}` helper to make settings available in templates without needing a backing class
- updated `<GhPostBookmark>` component
  - if post feature image isn't present, fall back to site cover image
  - add site icon (if present) and title to the details line
  - removed author image

Co-authored-by: Sanne de Vries <sannedv@protonmail.com>
2022-05-18 19:05:27 +01:00

22 lines
1.0 KiB
Handlebars

<div class="gh-post-bookmark-container">
<div class="gh-post-bookmark">
{{#let (or @post.featureImage (get-setting "coverImage")) as |imageUrl|}}
{{#if imageUrl}}
<div class="gh-post-bookmark-image">
<img src={{imageUrl}} alt="" role="presentation" />
</div>
{{/if}}
{{/let}}
<div class="gh-post-bookmark-content">
<div class="gh-post-bookmark-title">{{@post.title}}</div>
<div class="gh-post-bookmark-text truncate">{{@post.excerpt}}</div>
<div class="gh-post-bookmark-details">
{{#if (get-setting "icon")}}
<div class="gh-post-bookmark-site-icon"><img src={{get-setting "icon"}} alt="" role="presentation" /></div>
{{/if}}
<div class="gh-post-bookmark-site-title">{{get-setting "title"}}</div>
<div class="gh-post-bookmark-authors">{{post-author-names @post}}</div>
</div>
</div>
</div>
</div>