gorootde / silverbullet-collection

Collection of awesome silverbullet.md stuff
GNU General Public License v3.0
48 stars 0 forks source link

[FR] Banner widget? #10

Closed jvonhoff closed 1 month ago

jvonhoff commented 1 month ago

I was trying to recreate the banner plugin from Logseq, and while I made some progress, I think I'm missing a key piece.

---
description: Adds a Banner to tagged pages
banner: "https://media.torque.com.sg/public/2019/03/Bugatti-Chiron-front-exterior-4.jpg"
tags: template
hooks.top:
  where: 'true'
  order: 0
---
```template

![[{{@page.banner}}]]

!(banner)[{{@page.banner}}]

\```

This gives me a block at the top of every page that has some banner: metadata, but it doesn't render as a picture (see below), so I'm hoping to stir up enough interest to get some help.

image

jvonhoff commented 1 month ago

I guess I wasn't too far off... If I actually use the correct syntax (URL goes in parentheses, not brackets) it kinda works! It looks like the image sizing might not be working the way I thought it would, but it's a start! image

gorootde commented 1 month ago

Congrats for finding the solution on your own 👍 Would you like to contribute this as a template?

jvonhoff commented 1 month ago

Would you like to contribute this as a template?

Definitely, if anyone else can use it... That's what keeps the open source world turning, right?

gorootde commented 1 month ago

Awesome, looking forward to your PR

jvonhoff commented 1 month ago

Awesome, looking forward to your PR

It's there, but let me know if I need to tweak it! Thanks again!