Skip to content

Instantly share code, notes, and snippets.

@curiositry
Created November 5, 2022 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save curiositry/deb3da1a80192f6a1ac4ca8ff108a8ae to your computer and use it in GitHub Desktop.
Save curiositry/deb3da1a80192f6a1ac4ca8ff108a8ae to your computer and use it in GitHub Desktop.
Alternate weblog loop.hbs (goes in partials directory) with a lable next to featured posts instead of the date.
{{! Previous/next page links - only displayed on page 2+ }}
{{#if pagination.prev}}
<br>
<div class="center-text">
page {{pagination.page}} of {{pagination.pages}}
</div>
<br>
{{/if}}
{{! The loop itself }}
<ul style="list-style-type: none; padding-left: 0;">
{{#foreach posts visibility="all"}}
{{!> post-teaser}}
<li style="line-height: 2">
{{#if featured}}
[Featured] —
{{else}}
<time class="post-teaser__meta__date" datetime="{{date format='YYYY-MM-DD'}}">
{{date format="YYYY/MM/DD"}} —
</time>
{{/if}}
<a href="{{url}}">{{title}}</a>
</li>
{{/foreach}}
</ul>
{{! Previous/next page links - displayed on every page }}
<div class="center-text">
page {{pagination.page}} of {{pagination.pages}}
</div>
<br>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment