1
0
mirror of https://github.com/Damillora/Yuika synced 2024-12-26 06:03:45 +00:00

feat: new post design

This commit is contained in:
Damillora 2021-07-11 04:23:59 +07:00
parent d15da305d3
commit c44d80e0f1
4 changed files with 145 additions and 118 deletions

View File

@ -1,10 +1,13 @@
{{!< default}} {{#author}} {{> header-background background=cover_image}} <div class="page-header"> {{!< default}} <div class="page-header page-header--short">
<div class="page-header__background responsive-header-img"> <div class="page-header__background responsive-header-img">
<div class="page-header__overlay"></div> <div class="page-header__overlay"></div>
</div> </div>
<div class="page-header__contents"> <div class="page-header__contents">
</div>
</div>
{{#author}}
<div class="post-header container mx-auto main"> <div class="post-header container mx-auto main">
<p class="page-header__text"> <p class="post-header__text">
<span class="post-header__tag-name">Author</span> <span class="post-header__tag-name">Author</span>
</p> </p>
<div class="post-header__heading post-header__heading--tag"> <div class="post-header__heading post-header__heading--tag">
@ -20,32 +23,34 @@
{{else}} {{else}}
<span class="post-header__heading--tag-color"></span> <span class="post-header__heading--tag-color"></span>
{{/if}} {{/if}}
<h1 class="post-header__heading--tag-text"> <h1 class="post-header__heading">
{{name}} {{name}}
</h1> </h1>
</div> </div>
<p class="page-header__text"> <p class="post-header__text">
{{plural ../pagination.total empty='No posts' singular='% post' plural='% posts'}} {{plural ../pagination.total empty='No posts' singular='% post' plural='% posts'}}
</p> </p>
<p class="page-header__text"> <p class="post-header__text">
{{#if website}} {{#if website}}
<span class=""><a class="post-header__social" href="{{website}}" target="_blank" <span class=""><a href="{{website}}" target="_blank" rel="noopener">Website</a></span>
rel="noopener">Website</a></span>
{{/if}} {{/if}}
{{#if twitter}} {{#if twitter}}
<span class=""><a class="post-header__social" href="{{twitter_url}}" target="_blank" <span class=""><a href="{{twitter_url}}" target="_blank"
rel="noopener">Twitter</a></span> rel="noopener">Twitter</a></span>
{{/if}} {{/if}}
{{#if facebook}} {{#if facebook}}
<span class=""><a class="post-header__social" href="{{facebook_url}}" target="_blank" <span class=""><a href="{{facebook_url}}" target="_blank"
rel="noopener">Facebook</a></span> rel="noopener">Facebook</a></span>
{{/if}} {{/if}}
</p> </p>
{{#if bio}} {{#if bio}}
<p class="page-header__text">{{bio}}</p> <p class="page-header__text">{{bio}}</p>
{{/if}} {{/if}}
</div> {{#if cover_image}}
</div> <figure class="post-header__featured-image">
<img src="{{cover_image}}" alt="{{name}}" loading="lazy">
</figure>
{{/if}}
</div> </div>
{{/author}} {{/author}}
<main class="post-list container mx-auto"> <main class="post-list container mx-auto">

View File

@ -1,22 +1,32 @@
{{!< default}} {{#post}} <div class="relative group index-header"> {{!< default}} {{#post}} <div class="relative group index-header">
{{> header-background background=feature_image}} <div class="page-header page-header--short">
<div class="page-header"> <div class="page-header__background">
<div class="page-header__background responsive-header-img">
<div class="page-header__overlay"></div> <div class="page-header__overlay"></div>
</div> </div>
<div class="page-header__contents"> <div class="page-header__contents">
</div>
</div>
<div class="post-header container mx-auto main"> <div class="post-header container mx-auto main">
<h1 class="page-header__heading">{{title}}</h1> <h1 class="post-header__heading">{{title}}</h1>
</div> {{#if feature_image}}
</div> <figure class="post-header__featured-image">
<img src="{{feature_image}}" alt="{{feature_image_alt}}" loading="lazy">
{{#if feature_image_caption}}
<figcaption>{{feature_image_caption}}</figcaption>
{{/if}}
</figure>
{{/if}}
</div> </div>
<main id="post" class="container mx-auto main"> <main id="post" class="container mx-auto main">
{{content}} {{content}}
</main> </main>
{{/post}} {{/post}}
{{#contentFor "scripts"}} {{#contentFor "scripts"}}
<script> <script>
</script> </script>

View File

@ -1,14 +1,16 @@
{{!< default}} {{#post}} <div class="relative group index-header"> {{!< default}} {{#post}} <div class="relative group index-header">
{{> header-background background=feature_image}} <div class="page-header page-header--short">
<div class="page-header"> <div class="page-header__background">
<div class="page-header__background responsive-header-img">
<div class="page-header__overlay"></div> <div class="page-header__overlay"></div>
</div> </div>
<div class="page-header__contents"> <div class="page-header__contents">
</div>
</div>
<div class="post-header container mx-auto main"> <div class="post-header container mx-auto main">
{{> primary-tag}} {{> primary-tag}}
<h1 class="page-header__heading">{{title}}</h1> <h1 class="post-header__heading">{{title}}</h1>
<p class="post-header__time"> <p class="post-header__time">
<span> <span>
<time datetime="{{date format=" YYYY-MM-DD"}}"> <time datetime="{{date format=" YYYY-MM-DD"}}">
@ -40,16 +42,18 @@
</div> </div>
</div> </div>
{{/if}} {{/if}}
{{#if feature_image}}
<figure class="post-header__featured-image">
<img src="{{feature_image}}" alt="{{feature_image_alt}}" loading="lazy">
{{#if feature_image_caption}} {{#if feature_image_caption}}
<p class="post-header__caption">
<span class="post-header__caption-text"> <figcaption>{{feature_image_caption}}</figcaption>
{{feature_image_caption}} {{/if}}
</span> </figure>
</p>
{{/if}} {{/if}}
</div> </div>
</div>
</div>
<main id="post" class="container mx-auto main"> <main id="post" class="container mx-auto main">
{{content}} {{content}}

22
tag.hbs
View File

@ -1,15 +1,18 @@
{{!< default}} {{#tag}} {{> header-background background=feature_image}} {{!< default}}
<div class="page-header"> <div class="page-header page-header--short">
<div class="page-header__background responsive-header-img"> <div class="page-header__background">
<div class="page-header__overlay"></div> <div class="page-header__overlay"></div>
</div> </div>
<div class="page-header__contents"> <div class="page-header__contents">
</div>
</div>
{{#tag}}
<div class="post-header container mx-auto main"> <div class="post-header container mx-auto main">
<p> <p>
<span class="post-header__tag-name">Tag</span> <span class="post-header__tag-name">Tag</span>
</p> </p>
<div class="post-header__heading post-header__heading--tag"> <div class="post-header__heading post-header__heading--tag">
<h1 class="post-header__heading--tag-text"> <h1 class="post-header__heading">
{{name}} {{name}}
</h1> </h1>
{{#if accent_color}} {{#if accent_color}}
@ -18,9 +21,14 @@
<span class="post-header__heading--tag-color"></span> <span class="post-header__heading--tag-color"></span>
{{/if}} {{/if}}
</div> </div>
<p class="page-header__text">{{description}}</p> {{#if description}}
</div> <p>{{description}}</p>
</div> {{/if}}
{{#if feature_image}}
<figure class="post-header__featured-image">
<img src="{{feature_image}}" alt="{{name}}" loading="lazy">
</figure>
{{/if}}
</div> </div>
{{/tag}} {{/tag}}