Your sites Log in Sign up Menu

Internal links

questions tagged ‘Internal links’

Referencing a link to the current page while writing it?

Is there a way to reference the current page's URL while writing the post? I'd like to be able to create visible anchor links while I'm writing, but don't know of an easy way to include the post's URL. I know that you can put {#anchor-link-name} on a line to create an anchor link so that https://domain.com/path/#anchor-link-name will bring you to that line. I also know that if I use just a leading slash, it will append the slug to my base domain. i.e. [linked text](/some-slug] will automatically point to https://mydomain.com/some-slug. But how do include the path part before the post is published? Here's my idea: two leading slashes to indicate it should include the page's full URL and then append whatever is referenced to the end of that. That way, when writing, I could just put this text [🔗](//#anchor-link-name) {#anchor-link-name} next to a heading, and I'd get a visible bit of hypertext (the emoji) that links to a particular part of the very page its on. The full thing: ## A super cool heading [🔗](//#super-cool-heading) {#super-cool-heading} Or is there an existing way to accomplish the same thing?