Product Dev Back to Ghost

How to add and display Facebook and Twitter URLs

With the release of Ghost 0.8, you can include your Facebook Page URL as well as your Twitter Profile link within your blog settings. This tutorial will walk you through how to add each link to your settings, as well as how to display each link within your theme.

Update your blog settings

To get started, you'll first need to update your blog settings to include the URLs to your Facebook Page and your Twitter Profile.

Once added, save your settings.

Edit your theme

Next, you'll need to edit your theme files to display the profile links. For this example, we're going to add them to the footer of our blog, so we need to open the default.hbs file.

When you've got your theme file open in an text/HTML editor, add the snippets below to display your links.

Facebook

<section class="facebook">  
    <a href="{{facebook_url}}">Friend us on Facebook</a>
</section>  

Here we're using {{facebook_url}} to retrieve the path to the Facebook Page URL.

Twitter

 <section class="twitter">
    <a href="{{twitter_url}}">@TryGhost</a>
  </section>

Similar to how we displayed Facebook, you'll see we have {{twitter_url}}. The {{twitter_url}} populates the path to the Twitter Profile.

The finished product should look similar to this,