This may be old news to some of you but I didn’t see it documented so thought I’d share.
I managed to build in “linked list” style posts (e.g. Daring Fireball-style link posts) using the canonical URL override and a simple #has
statement on my main content template (content.hbs
in my case). Quick how-to:
-
Choose a tag to denote link posts. This can be internal (I used
#link
). -
Use {{#has}} to change the formatting only for link posts and link to the canonical URL. In my case, I also added an SVG symbol to the title. The canonical URL can be called using the
{{canonical_url}}
tag.
{{#has tag="#link"}}
<a href="{{canonical_url}}"><h1 class="single-title">{{title}} <svg class="icon-title single-icon"><use xlink:href="#title-link"></use></svg></h1></a>
{{else}}
<h1 class="single-title">{{title}}</h1>
{{/has}}
- Update the canonical URL under “post settings” and “meta data”. As seen here:
- (Optional) You can also use {{#has}} in the loop, if you want to denote link posts in your list of posts.
You can see this in action in the loop on my website — click “load more” if you don’t see one at the top. Here is an example of a link post directly.
Hope this is helpful!