mirror of
https://github.com/Damillora/Yuika
synced 2024-11-22 09:17:33 +00:00
129 lines
3.9 KiB
Handlebars
129 lines
3.9 KiB
Handlebars
{{!< default}}
|
|
|
|
{{#post}}
|
|
{{> "site-header"}}
|
|
<div class="relative group index-header">
|
|
{{> header-background background=feature_image}} {{!--Special header-image.hbs partial to generate the background image--}}
|
|
<div class="h-full opacity-50 bg-black">
|
|
</div>
|
|
</div>
|
|
<div class="absolute bottom-0 py-6 left-0 right-0">
|
|
<div class="container mx-auto content-full">
|
|
{{#if primary_tag}}
|
|
{{#primary_tag}}
|
|
<div>
|
|
<a href="{{url}}"><span class="primary-tag-header">{{name}}</span></a>
|
|
</div>
|
|
{{/primary_tag}}
|
|
{{/if}}
|
|
<div>
|
|
<h1 class="text-white font-light text-3xl md:text-4xl">{{title}}</h1>
|
|
</div>
|
|
<div class="mb-4">
|
|
<p><span class="text-white text-sm"><time datetime="{{date format="YYYY-MM-DD"}}">{{date format="D MMM YYYY"}}</time> <span class="bull">•</span> {{reading_time}}</span></p>
|
|
</div>
|
|
<div class="flex flex-row">
|
|
{{#foreach authors}}
|
|
{{#if profile_image}}
|
|
<div class="h-8 ml-1 mr-3">
|
|
<a href="{{url}}">
|
|
<img class="h-full rounded-full" src="{{img_url profile_image size="xs"}}" alt="{{name}}"/>
|
|
</a>
|
|
</div>
|
|
{{else}}
|
|
<a href="{{url}}" class="static-avatar author-profile-image">{{> "icons/avatar"}}</a>
|
|
{{/if}}
|
|
{{/foreach}}
|
|
<div class="text-white">
|
|
<p>{{#has author="count:>2"}}Multiple authors{{else}}{{authors}}{{/has}}</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<article class="post-article">
|
|
<main class="content container" id="post">
|
|
<div class="content-full">
|
|
{{content}}
|
|
</div>
|
|
<div class="content-full">
|
|
<div class="my-4" id="comments">
|
|
<div id="coral_thread"></div>
|
|
<script type="text/javascript">
|
|
(function() {
|
|
var d = document, s = d.createElement('script');
|
|
var url = 'comment.nanao.moe';
|
|
s.src = '//' + url + '/assets/js/embed.js';
|
|
s.async = false;
|
|
s.defer = true;
|
|
s.onload = function() {
|
|
Coral.createStreamEmbed({
|
|
id: "coral_thread",
|
|
autoRender: true,
|
|
rootURL: '//' + url,
|
|
});
|
|
};
|
|
(d.head || d.body).appendChild(s);
|
|
})();
|
|
</script>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
<div class="my-4 w-full content-full">
|
|
<div class="flex flex-row justify-between">
|
|
{{#prev_post}}
|
|
<div class="w-1/3">
|
|
<a href="{{url}}">
|
|
<div class="flex flex-col items-end">
|
|
<p class="text-xl text-blue-700">Previous post</p>
|
|
<p>{{title}}</p>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
{{/prev_post}}
|
|
<div class="flex flex-grow"></div>
|
|
{{#next_post}}
|
|
<div class="w-1/3">
|
|
<a href="{{url}}">
|
|
<div class="flex flex-col items-begin">
|
|
<p class="text-xl text-blue-700">Next post</p>
|
|
<p>{{title}}</p>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
{{/next_post}}
|
|
</div>
|
|
</div>
|
|
<div class="mx-auto px-4 my-4 w-full">
|
|
{{#if primary_tag}}
|
|
{{#get "posts" filter="tags:{{primary_tag.slug}}+id:-{{id}}" limit="3" as |related_posts|}}
|
|
{{#if related_posts}}
|
|
{{#../primary_tag}}
|
|
<div class="px-3 w-full">
|
|
<p class="text-2xl">More in <a href="{{url}}" class="bg-green-700 w-auto inline px-2 py-1 text-white text-2xl">{{name}}</a> </p>
|
|
</div>
|
|
{{/../primary_tag}}
|
|
<div class="flex flex-wrap justify-start w-full">
|
|
{{#foreach related_posts}}
|
|
{{> post-card}}
|
|
{{/foreach}}
|
|
</div>
|
|
{{/if}}
|
|
{{/get}}
|
|
{{/if}}
|
|
</div>
|
|
{{/post}}
|
|
</article>
|
|
|
|
{{#contentFor "scripts"}}
|
|
<script>
|
|
$(document).ready(function () {
|
|
// FitVids - start
|
|
var $postContent = $("#post");
|
|
$postContent.fitVids();
|
|
// FitVids - end
|
|
});
|
|
</script>
|
|
{{/contentFor}}
|