What's the purpose of using # in URLs?

I’ve noticed that some URLs on the ghost website have hashtags in them. For example, check the url if you scroll to the “creating a channel” section.

Edit: nvm, I realized that the hashtag drives table of contents functionality

Hey @mobiustrips ,

Yes, these # are the IDs of an element on that page. They help you navigate to that element via the table of contents or share a direct link to that section.

As seen in the image, #creating-a-channel is the id of the h3 element.

The table of contents library will automatically generate IDs for heading elements and use them as links in the TOC.

1 Like