title | template | page |
---|---|---|
Writings |
posts.html |
posts |
Created
May 12, 2015 18:07
-
-
Save johanbrook/d53be319f291ccd3c886 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.use collections | |
posts: | |
pattern: 'posts/**.html' | |
sortBy: 'date' | |
reverse: true | |
.use branch('posts/**.html').use( | |
permalinks(pattern: 'writings/:title', relative: false) | |
) | |
.use branch('!posts/**.html').use branch('!index.md').use permalinks | |
relative: false | |
.use pagination | |
'collections.posts': | |
path: 'writings/page/:num/index.html' | |
perPage: 1 | |
template: 'posts.html' | |
first: 'posts.html' | |
pageMetadata: | |
page: 'posts' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<main role="main"> | |
{{#each pagination.files}} | |
<article role="article"> | |
<header> | |
<time datetime="{{toISODate date}}" pubdate>{{ niceDate date 'MMMM D, YYYY'}}</time> | |
<h1><a href="/{{path}}">{{title}}</a></h1> | |
</header> | |
<div class="post-text"> | |
{{{excerpt}}} | |
<p class="read-more"> | |
<a href="/{{path}}">Read more…</a> | |
</p> | |
</div> | |
</article> | |
{{/each}} | |
<footer> | |
{{pagination.num}} - {{pagination.pages.length}} | |
</footer> | |
</main> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment