Create Link for Static Page


#1

Hello,

I’m brand new to ghost so bear with me.
I would like to create an href to a static page but am having an issue doing so.
Here is what I need to do.
<a href="<INeedPrefix>/contact"><i class="fa fa-envelop"></i></a>

How do i get the domain prefix? I don’t want to hard code it (shame on me if i do)? I’ve been looking around the docs and I don’t see anything. The only thought I have is to use #get to fetch a page by name, but can that be done?

Thank you


#2

Please follow my screenshot. At first #1 you have to select Turn this post into a page option and then add your custom page url there what you want as prefix/slug.

I hope it will help you. If you have any other question, feel free ask here.


#4

After doing what @themeix said, create a page-nameofpage.hbs file. There, your page has been created!

To insert a link, you must use the page slug generated in Ghost within the href attribute.

Example: <a href="/mypage/"><i class="fa fa-envelop"></i></a>


#5

Thank you Matheus and themeix. For some reason I was thinking I needed the url prefix when it’s relative. sigh.

Thanks for the responses.


#6

fwiw you can also use the {{@blog.url}} helper to get the base URL