-
Notifications
You must be signed in to change notification settings - Fork 22
/
page.hbs
162 lines (138 loc) · 5.84 KB
/
page.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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
{{! Page; this file renders a single page}}
{{> head}}
{{> navbar}}
<main>
{{! injects code via a Custom HTML tool - as defined in the config.json file in the "renderer" section }}
{{#if @customHTML.beforePage}}
<div id="custom-html-before-page">
{{{@customHTML.beforePage}}}
</div>
{{/if}}
{{! /injects code via a Custom HTML tool }}
{{! indicates the page's context}}
{{#page}}
<article>
<header>
{{! page title }}
<h1>
{{title}}
</h1>
{{! /page title }}
{{! page creation date }}
<time datetime="{{date createdAt 'YYYY-MM-DDTHH:mm'}}">
{{date createdAt}}
</time>
{{! /page creation date }}
{{! page author }}
{{ translate 'page.publishedBy' }}
{{#author}}
<a href="{{url}}" rel="author" title="{{name}}">{{name}}</a>
{{/author}}
{{! /page author }}
{{! page modification date }}
{{#if modifiedAt}}
{{ translate 'page.lastUpdatedDate' }}
<time datetime="{{date modifiedAt 'YYYY-MM-DDTHH:mm'}}">
{{date modifiedAt}}
</time>
{{/if}}
{{! /page modification date }}
</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>
{{/if}}
{{! /check if an image exists }}
{{/featuredImage}}
{{! /featured image }}
{{! page body }}
<div id="page-entry">
{{{text}}}
</div>
{{! /page body }}
{{! checks if the "displayAuthorBio" page option is enabled - the Page Options are defined in the config.json in the "pageConfig" section, and are accessible in the Theme -> Page Options section of Publii and in the page editor itself in the sidebar -> Other Options section }}
{{#if @config.page.displayAuthorBio}}
{{! author bio section }}
{{#author}}
<div id="author-bio">
{{! checks if an author avatar exists }}
{{#if avatar}}
<img
src="{{avatarImage.url}}"
{{ lazyload "lazy" }}
alt="{{avatarImage.alt}}"
height="{{avatarImage.height}}"
width="{{avatarImage.width}}">
{{/if}}
{{! /checks if an author avatar exists }}
{{! displays the author's name with a link to the author's page }}
<h3>
<a href="{{url}}" title="{{name}}">{{name}}</a>
</h3>
{{! /displays the author's name with a link to the author's page }}
{{! checks if an author description exists }}
{{#if description}}
<div> {{{description}}} </div>
{{/if}}
{{! /checks if an author description exists }}
</div>
{{/author}}
{{! /author bio section }}
{{/if}}
{{! /check if the "displayAuthorBio" Page option is enabled }}
</article>
{{! Checks if the "displayChildPages" page option is enabled - the Page Options are defined in the config.json in the "pageConfig" section and are accessible in the Theme -> Page Options section of Publii and in the page editor itself in the sidebar -> Other Options section }}
{{#if @config.page.displayChildPages}}
{{! Checks if subpages exist }}
{{#if subpages}}
<div class="subpages">
{{! Displays the heading for child pages }}
<h2>{{ translate 'page.childPages' }}</h2>
{{! Displays the list of subpages }}
<ul>
{{> subpages-list}}
</ul>
</div>
{{/if}}
{{! /Checks if subpages exist }}
{{/if}}
{{! /Checks if the "displayChildPages" page option is enabled }}
{{/page}}
{{! /indicates the page's context}}
{{! display comments plugin: it requires the "customComments" flag to be enabled in the "supportedFeatures" section of the config.json file}}
{{{@commentsCustomCode}}}
{{! /display comments plugin}}
{{! code injection by a Custom HTML tool - defined in config.json file in the renderer section}}
{{#if @customHTML.afterPage}}
<div id="custom-html-after-page">
{{{@customHTML.afterPage}}}
</div>
{{/if}}
{{! injects code via a Custom HTML tool }}
</main>
<aside>
{{> sidebar}}
</aside>
{{> footer}}