Files
ghost.sori.studio/post.hbs

97 lines
4.9 KiB
Handlebars

{{!< default}}
{{#post}}
<main class="flex-2 max-w-content">
<section class="px-4 sm:px-[max(2vmin,20px)] mt-6 mb-8">
<div class="max-w-content mx-auto flex flex-col gap-2.5">
<h1 class="font-semibold text-xl sm:text-2xl leading-[1.125]">{{title}}</h1>
<div class="relative border-b border-brd pb-4">
<div class="flex flex-wrap gap-2 sm:gap-1.5 items-center text-xs text-typ-tone *:after:content-['/'] *:after:ml-2 sm:*:after:ml-1.5 *:after:text-brd *:last:after:hidden!" data-post-card-info>
<time data-post-card-date datetime="{{date format="YYYY-MM-DD"}}">{{date format="MMM D, YYYY"}}</time>
{{#primary_author}}
<a data-post-card-author href="{{url}}" class="hover:opacity-75">{{name}}</a>
{{/primary_author}}
{{#if primary_tag}}
<ul class="flex flex-wrap items-center font-medium" data-post-card-tags>
<li{{#if primary_tag.accent_color}} style="--color-accent: {{primary_tag.accent_color}};"{{/if}}>
<a href="{{primary_tag.url}}" class="bg-accent/10 px-1.5 py-px rounded-sm text-typ hover:bg-accent/5 hover:text-accent">{{primary_tag.name}}</a>
</li>
</ul>
{{/if}}
{{#if comments}}
<a data-post-card-comments class="flex gap-0.5 items-center hover:opacity-75" href="#comments">
<img class="size-3.5 -mt-px pointer-events-none" src="{{asset "icons/chat_bubble.svg"}}" alt="">
<span class="pointer-events-none">{{comment_count empty="0" singular="" plural="" autowrap="false"}}</span>
</a>
{{/if}}
</div>
<button data-post-share-toggle class="absolute bottom-4 right-0 flex gap-1 items-center hover:opacity-75 cursor-pointer" type="button" aria-label="Share this post">
<img class="size-4 pointer-events-none" src="{{asset "icons/arrow_outward.svg"}}" alt="">
</button>
</div>
{{#if feature_image}}
<figure class="w-full h-full relative max-w-content mt-2.5">
<img
class="w-full object-cover rounded-theme aspect-[16/9] bg-bgr-tone"
srcset="{{img_url feature_image size="s"}} 300w, {{img_url feature_image size="m"}} 600w, {{img_url feature_image size="l"}} 1000w"
sizes="(max-width: 767px) 90vw, 720px"
src="{{img_url feature_image size="l"}}"
alt="{{#if feature_image_alt}}{{feature_image_alt}}{{else}}{{title}}{{/if}}"
>
</figure>
{{/if}}
</div>
</section>
<article class="post-article {{post_class}}">
<div class="post-body px-4 sm:px-[max(2vmin,20px)]">
<section class="post-content kg-content ghost-content prose prose-theme">
{{content}}
</section>
{{#unless access}}
<section class="membership-cta">
<h2>This post is for paying subscribers only</h2>
<a class="button button--light" href="#/portal/signup">Subscribe Now</a>
<p>Already have an account? <a href="#/portal/signin">Sign in</a></p>
</section>
{{/unless}}
<footer class="post-footer">
{{#primary_author}}
<div class="author-inline-card">
{{#if profile_image}}
<img class="avatar" src="{{img_url profile_image size="xs"}}" alt="{{name}}">
{{else}}
<div class="avatar avatar--fallback">A</div>
{{/if}}
<div>
<h3>{{name}}</h3>
{{#if bio}}<p>{{bio}}</p>{{/if}}
</div>
</div>
{{/primary_author}}
</footer>
</div>
</article>
{{> "post/post-navigation"}}
<section class="discussion-panel">
{{#if comments}}
{{comments title="Comments" count=true}}
{{else}}
<div class="comments-empty">
<h3>Join the discussion</h3>
<p>Become a member of {{@site.title}} to start commenting.</p>
<a class="button" href="#/portal/signup">Sign up now</a>
<p>Already a member? <a href="#/portal/signin">Sign in</a></p>
</div>
{{/if}}
</section>
</main>
{{/post}}