How to Get the Current Page URL on Ghost Blogging Platform
In Today, Ghost Tutorial series part we see about How to Get the Current Page URL on Ghost Blogging Platform.
Here are the Steps to Get the Current Page URL on Ghost Blogging Platform
Get the Current Page URL on Ghost Blog
{{url}} – it is the helper for all Process to Get the Homepage/Post/page/Blog URL
Here is Tag to get the Current Page URL
{{url absolute="true"}}
This tag will call the current page/post URL we can use this tags on share buttons and third party widget which needs the current page URL of your Post
How to Get Social Share Buttons URL on Ghost Blog?
Here I am going to List the Share Buttons with {{url}} tag which help us to Get the current page URL for Social Bookmarks
<a href="https://www.facebook.com/sharer/sharer.php?u={{url absolute="true"}}">Share on Facebook</a>
<a href="https://twitter.com/intent/tweet?text={{encode title}}&url={{url absolute="true"}}">Twitter</a>
Google+
<a href="https://plus.google.com/share?url={{url absolute="true"}}">Google+</a>
<a href="whatsapp://send?text={{encode title}} → {{url absolute="true"}}">Whatsapp</a>
<a href="https://pinterest.com/pin/create/button/?url={{url absolute="true"}}{{#if image}}&media={{@blog.url}}{{image}}{{/if}}&description={{excerpt words="20"}}" target="_blank">Pin it</a>
- {{url absolute=”true”}} – Get the Current Post URL for the Share Buttons
- For Twitter we use to {{encode title}} to Get the Current page title.Encode Will help us to Give the proper output in tweet share without Any Mess up’s in title texts.
- For WhatsApp we use {{title}} to Get the Current page title
How to Get the Blog URL in Ghost Blogging Platform?
Here is the Tag for Getting our Ghost Blog URL
{{@blog.url}}
These tags are Used in Logo, Footers, RSS Feeds.
Footer Example
<section class="copyright"><a href="{{@blog.url}}">{{@blog.title}}</a> © {{date format="YYYY"}}</section>
Logo Example
<a class="blog-logo" href="{{@blog.url}}"><img src="{{@blog.logo}}" alt="{{@blog.title}}" /></a>
RSS Feed Example
<a class="subscribe-button icon-feed" href="{{@blog.url}}/rss/">Subscribe</a>
Ghost Blog is already having the inbuilt RSS feed just open your feed like example.com/rss if you want to add this inside on your theme files add Just like this href=”{{@blog.url}}/rss/.”
Get the Current Page URL on Ghost
SNO | Tag | Usage |
1 | {{url}} | Global path for all |
2 | {{url absolute=”true”}} | Get Current Page URL |
3 | {{@blog.url}} | Get Blog URL |
These Tags are applied in
- Share Buttons
- Menu Links
- Images
- canonical URL
- RSS Feed
- Widgets
Hope this Guide will help you to understand the URL GET Method on Ghost Blogging Platform
Here is the Official Ghost Blog Documentation for – URL Handling
PHP Guide
Ghost Blog CMS Guides for you
- How to Install Ghost Blog CMS on Digitalocean
- How to Add Lazy Load Facebook Comments on Ghost Blog Posts
Your feedback helps us improve Allwebtuts.com