Is it possible to populate sections of md file's content in the single.html page?

I am trying to do two things. create a sticky sidebar that follow the height of a div where a heading is inside of. for example, from ## cats to the bottom of the div. the contents of the sidebar should be the last few lines of the ## cats header.

I have some a few TOC work where they highlight which header you’re currently on and thought of using these as a starting point. I have not written any code yet, i just want to see if anybody has some suggestions for where i can get started.

The idea came from this website https://www.divein.com/diving/dive-computer/ i want to create a similar sidebar experience

This is a CSS question and not really directly related to Hugo.

The YouTube channel of Kevin Powell has a lot of useful CSS resources. In a recent video he describes how to build just this functionality.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.