deno.land / x / lume_theme_simple_blog@v0.4.0 / src / archive.tmpl.js

archive.tmpl.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
export const layout = "layouts/archive.njk";export const title = "Archive";
export default function* ({ search, paginate }) { const posts = search.pages("type=post", "date=desc");
for ( const data of paginate(posts, { url, size: 10 }) ) { // Show the first page in the menu if (data.pagination.page === 1) { data.menu = { visible: true, order: 1, }; }
yield data; }}
function url(n) { if (n === 1) { return "/archive/"; }
return `/archive/${n}/`;}
lume_theme_simple_blog

Version Info

Tagged at
a year ago