mirror of
https://github.com/aljazceru/Journal-ghost.git
synced 2026-01-11 09:14:27 +01:00
[Journal] Fixed latest post query
fixes #138 When the homepage posts are queried from a custom collection, the latest post didn't use to respect what collection it's in. Now the theme utilizes the main query instead of a custom one for fetching the latest post, so the custom collection works as expected.
This commit is contained in:
46
index.hbs
46
index.hbs
@@ -3,32 +3,30 @@
|
||||
<main id="gh-main" class="gh-main gh-outer">
|
||||
<div class="gh-inner">
|
||||
{{^is "paged"}}
|
||||
{{#get "posts" limit="1"}}
|
||||
{{#foreach posts}}
|
||||
<article class="gh-latest gh-card {{post_class}}">
|
||||
<a class="gh-card-link" href="{{url}}">
|
||||
<header class="gh-card-header">
|
||||
<div class="gh-article-meta">
|
||||
<span class="gh-card-date">Latest — <time datetime="{{date format="YYYY-MM-DD"}}">{{date}}</time></span>
|
||||
</div>
|
||||
<h2 class="gh-article-title gh-card-title">{{title}}</h2>
|
||||
</header>
|
||||
{{#foreach posts limit="1"}}
|
||||
<article class="gh-latest gh-card {{post_class}}">
|
||||
<a class="gh-card-link" href="{{url}}">
|
||||
<header class="gh-card-header">
|
||||
<div class="gh-article-meta">
|
||||
<span class="gh-card-date">Latest — <time datetime="{{date format="YYYY-MM-DD"}}">{{date}}</time></span>
|
||||
</div>
|
||||
<h2 class="gh-article-title gh-card-title">{{title}}</h2>
|
||||
</header>
|
||||
|
||||
<p class="gh-article-excerpt">{{excerpt}}</p>
|
||||
<p class="gh-article-excerpt">{{excerpt}}</p>
|
||||
|
||||
<footer class="gh-card-meta">
|
||||
<span class="gh-card-duration">{{reading_time}}</span>
|
||||
{{#if @site.comments_enabled}}
|
||||
{{comment_count class="gh-card-comments"}}
|
||||
{{/if}}
|
||||
{{^has visibility="public"}}
|
||||
{{> icons/star}}
|
||||
{{/has}}
|
||||
</footer>
|
||||
</a>
|
||||
</article>
|
||||
{{/foreach}}
|
||||
{{/get}}
|
||||
<footer class="gh-card-meta">
|
||||
<span class="gh-card-duration">{{reading_time}}</span>
|
||||
{{#if @site.comments_enabled}}
|
||||
{{comment_count class="gh-card-comments"}}
|
||||
{{/if}}
|
||||
{{^has visibility="public"}}
|
||||
{{> icons/star}}
|
||||
{{/has}}
|
||||
</footer>
|
||||
</a>
|
||||
</article>
|
||||
{{/foreach}}
|
||||
{{/is}}
|
||||
|
||||
<div class="gh-wrapper">
|
||||
|
||||
Reference in New Issue
Block a user