-
Notifications
You must be signed in to change notification settings - Fork 24
/
amp-post.hbs
executable file
·110 lines (99 loc) · 4.29 KB
/
amp-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
{{> amp-head}}
<main class="wrap-page">
{{#post}}
<article class="post">
{{#featuredImage}}
{{#if url}}
<figure class="post-featured-image">
<amp-img
src="{{url}}"
alt="{{alt}}"
{{#if srcset.amp}}
srcset="{{srcset.amp}}"
{{else}}
{{#if srcset}}
srcset="{{srcset}}"
{{/if}}
{{/if}}
{{#if sizes.amp}}
sizes="{{sizes.amp}}"
{{else}}
{{#if sizes}}
sizes="{{sizes}}"
{{/if}}
{{/if}}
height="{{height}}"
layout="responsive"
width="{{width}}">
</amp-img>
{{#checkIfAny caption credits}}
<figcaption>
{{caption}} {{credits}}
</figcaption>
{{/checkIfAny}}
</figure>
{{/if}}
{{/featuredImage}}
<div class="wrap-inner">
<header class="post-header">
<h1>
{{title}}
</h1>
{{#checkIfAny @config.post.displayDate @config.post.displayAuthor}}
<p class="post-meta">
{{#if @config.post.displayAuthor}}
{{#author}}
{{ translate 'post.publishedBy' }}
<a href="{{url}}" rel="nofollow" title="{{name}}">{{name}}</a>
{{/author}}
{{/if}}
{{#if @config.post.displayDate}}
<time datetime="{{date createdAt 'YYYY-MM-DDTHH:mm'}}">
{{date createdAt @config.custom.formatDate}}
</time>
{{/if}}
</p>
{{/checkIfAny}}
</header>
{{{text}}}
{{#checkIfAny @config.post.displayTags @config.post.displayShareButtons}}
<aside>
{{#if @config.post.displayTags}}
{{#if tags}}
<ul class="post-tag">
{{#each tags}}
<li>
<a href="{{url}}">{{name}}</a>
</li>
{{/each}}
</ul>
{{/if}}
{{/if}}
{{#checkIf @config.post.displayShareButtons '&&' @amp.shareButtons}}
<div class="post-share">
{{> amp-share-buttons}}
</div>
{{/checkIf}}
</aside>
{{/checkIfAny}}
</div>
</article>
{{/post}}
{{#if @config.post.displayPostNavigation}}
<nav class="post-pagination wrap-inner">
{{#previousPost}}
<div class="post-pagination-prev">
<span>{{ translate 'post.previousPost' }}</span>
<a href="{{url}}">{{title}}</a>
</div>
{{/previousPost}}
{{#nextPost}}
<div class="post-pagination-next">
<span>{{ translate 'post.nextPost' }}</span>
<a href="{{url}}">{{title}}</a>
</div>
{{/nextPost}}
</nav>
{{/if}}
</main>
{{> amp-footer}}