ghost-theme-sd.ai/partials/components/post-list.hbs
2023-08-14 09:10:22 +08:00

68 lines
2.8 KiB
Handlebars

<section class="gh-container is-{{#match @custom.post_feed_style "List"}}list{{else}}grid{{/match}}{{#if @custom.show_sidebar}} has-sidebar{{/if}}{{#unless @custom.show_images_in_feed}} no-image{{/unless}} gh-outer">
<div class="gh-container-inner gh-inner">
<h2 class="gh-container-title">Latest</h2>
<main class="gh-main">
<div class="gh-feed">
{{#match @custom.header_style "Highlight"}}
{{#match posts.length ">=" 10}}
{{#foreach posts from="11" limit="9"}}
{{> "post-card"}}
{{/foreach}}
{{else}}
{{#foreach posts limit="9"}}
{{> "post-card"}}
{{/foreach}}
{{/match}}
{{else match @custom.header_style "Magazine"}}
{{#match posts.length ">=" 7}}
{{#foreach posts from="8" limit="9"}}
{{> "post-card"}}
{{/foreach}}
{{else}}
{{#foreach posts limit="9"}}
{{> "post-card"}}
{{/foreach}}
{{/match}}
{{else}}
{{#foreach posts limit="9"}}
{{> "post-card"}}
{{/foreach}}
{{/match}}
</div>
</main>
{{#if @custom.show_sidebar}}
<aside class="gh-sidebar">
<section class="gh-about">
{{#if @site.icon}}
<img class="gh-about-icon" src="{{@site.icon}}" alt="{{@site.title}}">
{{/if}}
<h3 class="gh-about-title is-title">{{@site.title}}</h3>
{{#if @site.description}}
<p class="gh-about-description is-body">{{@site.description}}</p>
{{/if}}
{{#if @site.members_enabled}}
{{#unless @member}}
<button class="gh-button" data-portal="signup">Subscribe</button>
{{else}}
{{#if @site.paid_members_enabled}}
{{#unless @member.paid}}
<button class="gh-button" data-portal="upgrade">Subscribe</button>
{{/unless}}
{{/if}}
{{/unless}}
{{/if}}
</section>
</aside>
{{/if}}
{{#match pagination.pages ">" 1}}
<div class="gh-more is-title">
<a href="/page/2">See all →</a>
</div>
{{/match}}
</div>
</section>