Cleaned up post list component
This commit is contained in:
parent
06d844910a
commit
6957063474
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -294,6 +294,10 @@ button.gh-form-input {
|
||||
padding: 0 max(4vmin, 20px);
|
||||
}
|
||||
|
||||
.gh-outer .gh-outer {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.gh-inner {
|
||||
margin: 0 auto;
|
||||
max-width: var(--container-width);
|
||||
|
33
author.hbs
33
author.hbs
@ -36,37 +36,6 @@
|
||||
</section>
|
||||
{{/author}}
|
||||
|
||||
<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}}">
|
||||
<div class="gh-container-inner gh-inner">
|
||||
|
||||
<main class="gh-main">
|
||||
<div class="gh-feed">
|
||||
{{#foreach posts}}
|
||||
{{> "post-card"}}
|
||||
{{/foreach}}
|
||||
</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">Subscribe</button>
|
||||
{{/unless}}
|
||||
{{/if}}
|
||||
</section>
|
||||
</aside>
|
||||
{{/if}}
|
||||
|
||||
</div>
|
||||
</section>
|
||||
{{> "components/post-list" feed="archive" postFeedStyle=@custom.post_feed_style showTitle=false showSidebar=@custom.show_sidebar}}
|
||||
|
||||
</main>
|
4
home.hbs
4
home.hbs
@ -7,8 +7,6 @@
|
||||
{{> "components/featured" showFeatured=@custom.highlight_featured_posts limit=4}}
|
||||
{{/match}}
|
||||
|
||||
|
||||
{{> "components/cta"}}
|
||||
|
||||
|
||||
{{> "components/post-list" postListStyle=@custom.post_feed_style}}
|
||||
{{> "components/post-list" feed="home" postFeedStyle=@custom.post_feed_style showTitle=true showSidebar=@custom.show_sidebar}}
|
46
index.hbs
46
index.hbs
@ -1,48 +1,6 @@
|
||||
{{!< default}}
|
||||
{{!-- The tag above means: insert everything in this file into the body of the default.hbs template --}}
|
||||
|
||||
<main class="gh-main gh-outer">
|
||||
|
||||
<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}}">
|
||||
<div class="gh-container-inner gh-inner">
|
||||
|
||||
<h2 class="gh-container-title">Latest</h2>
|
||||
|
||||
<main class="gh-main">
|
||||
<div class="gh-feed">
|
||||
{{#match pagination.page 2}}
|
||||
{{#get "posts" include="authors" limit=@config.posts_per_page as |recent|}}
|
||||
{{#foreach recent}}
|
||||
{{> "post-card"}}
|
||||
{{/foreach}}
|
||||
{{/get}}
|
||||
{{/match}}
|
||||
{{#foreach posts}}
|
||||
{{> "post-card"}}
|
||||
{{/foreach}}
|
||||
</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">Subscribe</button>
|
||||
{{/unless}}
|
||||
{{/if}}
|
||||
</section>
|
||||
</aside>
|
||||
{{/if}}
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<main class="gh-main">
|
||||
{{> "components/post-list" feed="index" postFeedStyle=@custom.post_feed_style showTitle=true showSidebar=@custom.show_sidebar}}
|
||||
</main>
|
@ -1,39 +1,82 @@
|
||||
<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">
|
||||
{{!--
|
||||
Parameters:
|
||||
* feed (index, home, archive, recent)
|
||||
* postFeedStyle (list, grid)
|
||||
* showTitle (true, false)
|
||||
* showSidebar (true, false)
|
||||
--}}
|
||||
|
||||
<section class="gh-container is-{{#match postFeedStyle "List"}}list{{else}}grid{{/match}}{{#if showSidebar}} 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>
|
||||
{{#if showTitle}}
|
||||
<h2 class="gh-container-title">
|
||||
{{#unless title}}Latest{{else}}{{title}}{{/unless}}
|
||||
</h2>
|
||||
{{/if}}
|
||||
|
||||
<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}}
|
||||
|
||||
{{#match feed "home"}}
|
||||
{{#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}}
|
||||
{{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}}
|
||||
|
||||
{{#match feed "index"}}
|
||||
{{#match pagination.page 2}}
|
||||
{{#get "posts" include="authors" limit=@config.posts_per_page as |recent|}}
|
||||
{{#foreach recent}}
|
||||
{{> "post-card"}}
|
||||
{{/foreach}}
|
||||
{{/get}}
|
||||
{{/match}}
|
||||
{{else}}
|
||||
{{#foreach posts limit="9"}}
|
||||
{{#foreach posts}}
|
||||
{{> "post-card"}}
|
||||
{{/foreach}}
|
||||
{{/match}}
|
||||
|
||||
{{#match feed "archive"}}
|
||||
{{#foreach posts}}
|
||||
{{> "post-card"}}
|
||||
{{/foreach}}
|
||||
{{/match}}
|
||||
|
||||
{{#match feed "recent"}}
|
||||
{{#get "posts" include="authors" filter="id:-{{post.id}}" limit="4" as |next|}}
|
||||
{{#foreach next}}
|
||||
{{> "post-card"}}
|
||||
{{/foreach}}
|
||||
{{/get}}
|
||||
{{/match}}
|
||||
|
||||
</div>
|
||||
</main>
|
||||
|
||||
{{#if @custom.show_sidebar}}
|
||||
{{#if showSidebar}}
|
||||
<aside class="gh-sidebar">
|
||||
<section class="gh-about">
|
||||
{{#if @site.icon}}
|
||||
|
@ -1,12 +0,0 @@
|
||||
<section class="gh-container is-{{#match @custom.post_feed_style "List"}}grid{{else}}grid{{/match}}{{#unless @custom.show_images_in_feed}} no-image{{/unless}} gh-outer">
|
||||
<div class="gh-container-inner gh-inner">
|
||||
<h2 class="gh-container-title">Read more</h2>
|
||||
<div class="gh-feed">
|
||||
{{#get "posts" include="authors" filter="id:-{{post.id}}" limit="4" as |next|}}
|
||||
{{#foreach next}}
|
||||
{{> "post-card"}}
|
||||
{{/foreach}}
|
||||
{{/get}}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
2
post.hbs
2
post.hbs
@ -60,4 +60,4 @@
|
||||
|
||||
{{/post}}
|
||||
|
||||
{{> "recent-posts"}}
|
||||
{{> "components/post-list" feed="recent" postFeedStyle="Grid" title="Read more" showTitle=true showSidebar=false}}
|
33
tag.hbs
33
tag.hbs
@ -15,37 +15,6 @@
|
||||
</section>
|
||||
{{/tag}}
|
||||
|
||||
<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}}">
|
||||
<div class="gh-container-inner gh-inner">
|
||||
|
||||
<main class="gh-main">
|
||||
<div class="gh-feed">
|
||||
{{#foreach posts}}
|
||||
{{> "post-card"}}
|
||||
{{/foreach}}
|
||||
</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">Subscribe</button>
|
||||
{{/unless}}
|
||||
{{/if}}
|
||||
</section>
|
||||
</aside>
|
||||
{{/if}}
|
||||
|
||||
</div>
|
||||
</section>
|
||||
{{> "components/post-list" feed="archive" postFeedStyle=@custom.post_feed_style showTitle=false showSidebar=@custom.show_sidebar}}
|
||||
|
||||
</main>
|
Loading…
Reference in New Issue
Block a user