Post meta

This commit is contained in:
Sodbileg Gansukh 2023-07-10 14:03:07 +08:00
parent 05eefe6aeb
commit 42781d56ef
7 changed files with 47 additions and 5 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -607,6 +607,17 @@ Search LOGO Login Subscribe
flex-grow: 1; flex-grow: 1;
} }
.gh-card-meta {
display: flex;
gap: 4px;
flex-wrap: wrap;
}
.gh-card-author + .gh-card-date::before {
content: "—";
margin-right: 4px;
}
/* 6. Header */ /* 6. Header */
/* 6.1. Magazine layout */ /* 6.1. Magazine layout */
@ -667,6 +678,7 @@ Search LOGO Login Subscribe
.gh-featured-feed .gh-card-link { .gh-featured-feed .gh-card-link {
display: flex; display: flex;
flex-direction: row-reverse; flex-direction: row-reverse;
align-items: flex-start;
} }
.gh-featured-feed .gh-card-image { .gh-featured-feed .gh-card-image {
@ -717,6 +729,7 @@ Search LOGO Login Subscribe
.gh-container.is-list .gh-card-link { .gh-container.is-list .gh-card-link {
display: flex; display: flex;
gap: 24px;
} }
.gh-container.is-list .gh-card-image { .gh-container.is-list .gh-card-image {
@ -730,3 +743,9 @@ Search LOGO Login Subscribe
display: grid; display: grid;
grid-template-columns: repeat(3, 1fr); grid-template-columns: repeat(3, 1fr);
} }
/* 9.3. No image */
.gh-container.is-list.no-image .gh-card-image {
display: none;
}

View File

@ -119,6 +119,21 @@
"default": "List", "default": "List",
"group": "homepage" "group": "homepage"
}, },
"hide_images": {
"type": "boolean",
"default": false,
"group": "homepage"
},
"show_author": {
"type": "boolean",
"default": true,
"group": "homepage"
},
"show_post_date": {
"type": "boolean",
"default": true,
"group": "homepage"
},
"show_sidebar": { "show_sidebar": {
"type": "boolean", "type": "boolean",
"default": true, "default": true,

View File

@ -1,5 +1,5 @@
{{#if showFeatured}} {{#if showFeatured}}
{{#get "posts" filter="featured:true" limit="4" as |featured|}} {{#get "posts" filter="featured:true" include="authors" limit="4" as |featured|}}
{{#if featured}} {{#if featured}}
<section class="gh-featured gh-outer"> <section class="gh-featured gh-outer">
<div class="gh-featured-inner gh-inner"> <div class="gh-featured-inner gh-inner">

View File

@ -1,4 +1,4 @@
<section class="gh-container is-{{#match @custom.post_list_style "List"}}list{{else}}grid{{/match}}{{#if @custom.show_sidebar}} has-sidebar{{/if}} gh-outer"> <section class="gh-container is-{{#match @custom.post_list_style "List"}}list{{else}}grid{{/match}}{{#if @custom.show_sidebar}} has-sidebar{{/if}}{{#if @custom.hide_images}} no-image{{/if}} gh-outer">
<div class="gh-container-inner gh-inner"> <div class="gh-container-inner gh-inner">
<main class="gh-main"> <main class="gh-main">

View File

@ -15,8 +15,16 @@
</figure> </figure>
{{/if}} {{/if}}
<div class="gh-card-wrapper"> <div class="gh-card-wrapper">
<h2 class="gh-card-title">{{title}}</h2> <h3 class="gh-card-title">{{title}}</h3>
<p class="gh-card-excerpt">{{excerpt}}</p> <p class="gh-card-excerpt">{{excerpt}}</p>
<footer class="gh-card-meta">
{{#if @custom.show_author}}
<span class="gh-card-author">By {{#foreach authors}}{{#if @first}}{{name}}{{else}}, {{name}}{{/if}}{{/foreach}}</span>
{{/if}}
{{#if @custom.show_post_date}}
<time class="gh-card-date" datetime="{{date format="YYYY-MM-DD"}}">{{date}}</time>
{{/if}}
</footer>
</div> </div>
</a> </a>
</article> </article>