-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.11ty.js
37 lines (35 loc) · 906 Bytes
/
index.11ty.js
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
import { html } from './lib/html.js'
export function data() {
return {
layout: 'default',
}
}
export function render(data) {
return html`
<header>
<h1>${data.site.title}</h1>
</header>
<main>
<div class="content">
<section>
<h2>Posts</h2>
${data?.collections?.posts?.toReversed()
?.map((post) => {
return html`<article class="plug">
<h3><a href="${post.url}">${post.data.title}</a></h3>
<p>
${new Intl.DateTimeFormat('en-US', {
year: 'numeric',
day: 'numeric',
month: 'short',
timeZone: 'Europe/Berlin',
}).format(post.data.date)}
</p>
</article>`
})
.join('\n')}
</section>
</div>
</main>
`
}