Skip to content

Commit

Permalink
feat: add referrerpolicy for image
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Wang <[email protected]>
  • Loading branch information
ruibaby committed Jun 14, 2024
1 parent fa95355 commit eb38afe
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/hyperlink-card/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,6 @@
<hyperlink-card href="https://github.com/tanstack/query"></hyperlink-card>
<hyperlink-card href="https://www.halo.run/store/apps/app-gFkMn"></hyperlink-card>
<hyperlink-card href="https://bbs.halo.run/"></hyperlink-card>
<hyperlink-card href="https://www.bilibili.com/video/BV1tD421M75i/"></hyperlink-card>
</body>
</html>
1 change: 1 addition & 0 deletions packages/hyperlink-card/src/hyperlink-inline-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export class HyperlinkInlineCard extends LitElement {
? html`<img
class="size-4 rounded-sm"
src=${this.siteData.icon || this.siteData.image || ''}
referrerpolicy="no-referrer"
/>`
: ''}
<span>${this.siteData.title || this.href}</span>
Expand Down
1 change: 1 addition & 0 deletions packages/hyperlink-card/src/themes/grid-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export class HyperlinkGridCard extends LitElement {
<img
class="rounded-lg size-full object-cover aspect-16/9"
src=${this.siteData?.image || this.siteData?.icon || ''}
referrerpolicy="no-referrer"
/>
</div>`
: ''}
Expand Down
12 changes: 10 additions & 2 deletions packages/hyperlink-card/src/themes/regular-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,20 @@ export class HyperlinkRegularCard extends LitElement {
: ''}
${this.siteData?.image
? html`<div class="aspect-16/9 w-full sm:w-56 flex-none z-[1]">
<img class="rounded-lg size-full object-cover" src=${this.siteData?.image} />
<img
class="rounded-lg size-full object-cover"
src=${this.siteData?.image}
referrerpolicy="no-referrer"
/>
</div>`
: ''}
${!this.siteData?.image && this.siteData?.icon
? html`<div class="aspect-square w-full sm:w-18 flex-none z-[1]">
<img class="rounded-lg size-full object-cover" src=${this.siteData?.icon} />
<img
class="rounded-lg size-full object-cover"
src=${this.siteData?.icon}
referrerpolicy="no-referrer"
/>
</div>`
: ''}
Expand Down
1 change: 1 addition & 0 deletions packages/hyperlink-card/src/themes/small-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export class HyperlinkSmallCard extends LitElement {
<img
class="rounded-lg size-full object-cover"
src=${this.siteData.icon || this.siteData?.image || ''}
referrerpolicy="no-referrer"
/>
</div>`
: ''}
Expand Down

0 comments on commit eb38afe

Please sign in to comment.