jhvanderschee / hugobricks

MIT License
66 stars 24 forks source link

Anchor support? #64

Open tamis-laan opened 1 month ago

tamis-laan commented 1 month ago

I want to reference sections, or bricks using anchors. For example https://www.hugobricks.preview.usecue.com/#available where #available would reference the What bricks are available? section.

Is there a way to do this already or is this something that needs to be build?

iroQuai commented 1 month ago

It's possible on the frontpage: https://github.com/jhvanderschee/hugobricks/issues/44#issuecomment-1739904849

tamis-laan commented 1 month ago

@iroQuai As far as I can read you get the id from h2 header of a brick?

You can set anchors in markdown using: ## my title {#myanchor} This works but it gives bad results as anchor is attached to the heading not the div surrounding the brick. This causes you to scroll to a point only a percentage of the brick is visible.

iroQuai commented 1 month ago

A yeah I only tried anchors for subheaders on the main page to link to the different blocks. Your way sounds more sophisticated, it would be great if it would be supported!