-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpost.hbs
142 lines (129 loc) · 4.28 KB
/
post.hbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
{{! Post page; this file renders a single post and loads all the content}}
{{> head}}
{{> navbar}}
<div class="uk-section">
<div class="uk-container uk-container-small uk-animation-fade">
{{! injects code via a Custom HTML tool - as defined in the config.json file in the "renderer" section }}
{{#if @customHTML.beforePost}}
<div id="custom-html-before-post">
{{{@customHTML.beforePost}}}
</div>
{{/if}}
{{! /injects code via a Custom HTML tool }}
{{! indicates the post's context}}
<div uk-grid>
<div class="uk-width-expand@s">
{{#post}}
<article class="uk-article">
{{! post title }}
<h1 class="uk-article-title uk-text-center">
{{title}}
</h1>
{{! /post title }}
{{! post header }}
<div class="uk-article-meta">
{{! post author }}
{{ translate 'post.publishedBy' }}
{{#author}}
<a href="{{url}}" rel="author" title="{{name}}">{{name}}</a>
{{/author}}
{{! /post author }}
{{! post creation date }}
{{ translate 'post.publishedDate' }}
<time
datetime="{{date createdAt 'YYYY-MM-DDTHH:mm'}}"
>
{{date createdAt}}.
</time>
{{! /post creation date }}
{{! post modification date }}
{{#if modifiedAt}}
{{ translate 'post.lastUpdatedDate' }}
<time datetime="{{date modifiedAt 'YYYY-MM-DDTHH:mm'}}">
{{date modifiedAt}}.
</time>
{{/if}}
{{! /post modification date }}
{{! main tag - if not selected, the first tag in the list of all tags will be displayed }}
{{#if mainTag}}
{{ translate 'post.mainTag' }}
{{!-- <a href="{{ mainTag.url }}"> --}}
{{mainTag.name }}.
{{!-- </a> --}}
{{/if}}
{{! /main tag }}
</div>
{{! /post header }}
{{! featured image }}
{{#featuredImage}}
{{! check if an image exists }}
{{#if url}}
<figure id="featured-image">
<img
src="{{url}}"
{{! checks if the Responsive Images option (located in Site Settings -> Website Speed) is enabled }}
{{#if @config.site.responsiveImages}}
{{responsiveImageAttributes 'featuredImage' srcset sizes}}
{{/if}}
{{! generates a native loading attribute; if the Media Lazy Load option (located in Site Settings -> Website Speed) is disabled, the loading attribute is not generated }}
{{ lazyload "eager" }}
height="{{height}}"
width="{{width}}"
alt="{{alt}}"
>
{{! checks if the caption or credits exist }}
{{#checkIfAny caption credits}}
<figcaption>
{{caption}}
{{credits}}
</figcaption>
{{/checkIfAny}}
{{! /checks if the caption or credits exist }}
</figure>
{{else}}
<div class="uk-cover-container uk-height-small">
<canvas width="" height=""></canvas>
<img
src="{{@config.custom.postDefaultHeaderImageUrl}}"
{{! generates a native loading attribute; if the Media Lazy Load option (located in Site Settings -> Website Speed) is disabled, the loading attribute is not generated }}
{{ lazyload "eager" }} uk-cover
>
</div>
{{/if}}
{{! /check if an image exists }}
{{/featuredImage}}
{{! /featured image }}
{{! post body }}
<p>
{{{text}}}
</p>
{{! /post body }}
</article>
{{/post}}
<a href="#" uk-totop uk-scroll uk-sticky></a>
</div>
{{! /indicates the post's context}}
</div>
{{! code injection by a Custom HTML tool - defined in config.json file in the renderer section}}
{{#if @customHTML.afterPost}}
<div id="custom-html-after-post">
{{{@customHTML.afterPost}}}
</div>
{{/if}}
{{! injects code via a Custom HTML tool }}
</div>
</div>
<div class="uk-section">
<div class="uk-container uk-dark" uk-scrollspy="cls: uk-animation-slide-right">
<h2 class="uk-heading-divider uk-text-center">Continue reading</h2>
<div class="uk-grid-small uk-child-width-1-2@m" uk-grid="masonry: true">
{{#previousPost}}
<div>{{> post-card post=. }}</div>
{{/previousPost}}
{{#nextPost}}
<div>{{> post-card post=. }}</div>
{{/nextPost}}
</div>
</div>
</div>
{{> footer}}