Skip to content

Commit bbe6273

Browse files
committed
post: link-rust-cxx-lib
1 parent 8684d38 commit bbe6273

File tree

21 files changed

+1060
-935
lines changed

21 files changed

+1060
-935
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
_site
2-
_cache
1+
_site
2+
_cache

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
switching from **gohugo** to **lume**
2-
3-
still working on fundamentals:
4-
5-
- [x] pagination
6-
- [x] archetypes
7-
- [ ] article layout
8-
- [ ] i18n
1+
switching from **gohugo** to **lume**
2+
3+
still working on fundamentals:
4+
5+
- [x] pagination
6+
- [x] archetypes
7+
- [ ] article layout
8+
- [ ] i18n

_config.ts

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
import lume from 'lume/mod.ts';
2-
import date from 'lume/plugins/date.ts';
3-
import paginate from 'lume/plugins/paginate.ts';
4-
import codeHighlight from 'lume/plugins/code_highlight.ts';
5-
6-
const site = lume({
7-
src: '/src/',
8-
})
9-
.add('/styles.css')
10-
.use(date())
11-
.use(paginate())
12-
.use(
13-
codeHighlight({
14-
theme: [
15-
{
16-
name: 'atom-one-light',
17-
cssFile: '/styles.css',
18-
placeholder: '/* light-theme-here */',
19-
},
20-
{
21-
name: 'atom-one-dark',
22-
cssFile: '/styles.css',
23-
placeholder: '/* dark-theme-here */',
24-
},
25-
],
26-
})
27-
);
28-
29-
export default site;
1+
import lume from 'lume/mod.ts';
2+
import date from 'lume/plugins/date.ts';
3+
import paginate from 'lume/plugins/paginate.ts';
4+
import codeHighlight from 'lume/plugins/code_highlight.ts';
5+
6+
const site = lume({
7+
src: '/src/',
8+
})
9+
.add('/styles.css')
10+
.use(date())
11+
.use(paginate())
12+
.use(
13+
codeHighlight({
14+
theme: [
15+
{
16+
name: 'atom-one-light',
17+
cssFile: '/styles.css',
18+
placeholder: '/* light-theme-here */',
19+
},
20+
{
21+
name: 'atom-one-dark',
22+
cssFile: '/styles.css',
23+
placeholder: '/* dark-theme-here */',
24+
},
25+
],
26+
})
27+
);
28+
29+
export default site;

deno.json

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
{
2-
"imports": {
3-
"lume/": "https://deno.land/x/[email protected]/",
4-
"lume/jsx-runtime": "https://deno.land/x/[email protected]/jsx-runtime.ts",
5-
"lume/cms/": "https://cdn.jsdelivr.net/gh/lumeland/[email protected]/"
6-
},
7-
"tasks": {
8-
"lume": "echo \"import 'lume/cli.ts'\" | deno run -A -",
9-
"build": "deno task lume",
10-
"serve": "deno task lume -s",
11-
"cms": "deno task lume cms"
12-
},
13-
"compilerOptions": {
14-
"types": [
15-
"lume/types.ts"
16-
],
17-
"jsx": "react-jsx",
18-
"jsxImportSource": "lume"
19-
},
20-
"unstable": [
21-
"temporal"
22-
],
23-
"lint": {
24-
"plugins": [
25-
"https://deno.land/x/[email protected]/lint.ts"
26-
]
27-
}
28-
}
1+
{
2+
"imports": {
3+
"lume/": "https://deno.land/x/[email protected]/",
4+
"lume/jsx-runtime": "https://deno.land/x/[email protected]/jsx-runtime.ts",
5+
"lume/cms/": "https://cdn.jsdelivr.net/gh/lumeland/[email protected]/"
6+
},
7+
"tasks": {
8+
"lume": "echo \"import 'lume/cli.ts'\" | deno run -A -",
9+
"build": "deno task lume",
10+
"serve": "deno task lume -s",
11+
"cms": "deno task lume cms"
12+
},
13+
"compilerOptions": {
14+
"types": [
15+
"lume/types.ts"
16+
],
17+
"jsx": "react-jsx",
18+
"jsxImportSource": "lume"
19+
},
20+
"unstable": [
21+
"temporal"
22+
],
23+
"lint": {
24+
"plugins": [
25+
"https://deno.land/x/[email protected]/lint.ts"
26+
]
27+
}
28+
}

src/_archetypes/post.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
export default function (title: string) {
2-
if (title.trim() === '') {
3-
throw new Error('title is not provided.');
4-
}
5-
6-
return {
7-
path: `/posts/${title.replace(/\s+/g, '-').toLowerCase()}/index.md`,
8-
content: {
9-
title: title,
10-
date: new Date().toISOString(),
11-
tags: [],
12-
},
13-
};
14-
}
1+
export default function (title: string) {
2+
if (title.trim() === '') {
3+
throw new Error('title is not provided.');
4+
}
5+
6+
return {
7+
path: `/posts/${title.replace(/\s+/g, '-').toLowerCase()}/index.md`,
8+
content: {
9+
title: title,
10+
date: new Date().toISOString(),
11+
tags: [],
12+
},
13+
};
14+
}

src/_includes/layouts/base.vto

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
<!DOCTYPE html>
2-
<html lang="en">
3-
4-
<head>
5-
<meta charset="UTF-8" />
6-
<title>proxyerium's blog</title>
7-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
8-
<link rel="stylesheet" href="/styles.css">
9-
</head>
10-
11-
<body>
12-
{{content}}
13-
</body>
14-
15-
</html>
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8" />
6+
<title>proxyerium's blog</title>
7+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
8+
<link rel="stylesheet" href="/styles.css">
9+
</head>
10+
11+
<body>
12+
{{content}}
13+
</body>
14+
15+
</html>

src/_includes/layouts/lists.vto

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
---
2-
layout: layouts/base.vto
3-
---
4-
5-
<main id="posts">
6-
7-
<p>proxyerium::blog</p>
8-
<a href="..">back</a>
9-
<div>
10-
11-
{{for result of results}}
12-
<a href="{{result.url}}">
13-
<p>{{result.title}} <br> {{result.date |> date('yyyy-MM-dd HH:mm')}}</p>
14-
</a>
15-
{{/for}}
16-
17-
{{if pagination.previous }}
18-
<a href="{{pagination.previous}}">prev⬅</a>
19-
{{/if}}
20-
21-
<span>{{pagination.page}} of {{pagination.totalPages}}</span>
22-
23-
{{if pagination.next }}
24-
<a href="{{pagination.next}}">➡next</a>
25-
{{/if}}
26-
27-
</div>
28-
29-
</main>
1+
---
2+
layout: layouts/base.vto
3+
---
4+
5+
<main id="posts">
6+
7+
<p>proxyerium::blog</p>
8+
<a href="..">back</a>
9+
<div>
10+
11+
{{for result of results}}
12+
<a href="{{result.url}}">
13+
<p>{{result.title}} <br> {{result.date |> date('yyyy-MM-dd HH:mm')}}</p>
14+
</a>
15+
{{/for}}
16+
17+
{{if pagination.previous }}
18+
<a href="{{pagination.previous}}">prev⬅</a>
19+
{{/if}}
20+
21+
<span>{{pagination.page}} of {{pagination.totalPages}}</span>
22+
23+
{{if pagination.next }}
24+
<a href="{{pagination.next}}">➡next</a>
25+
{{/if}}
26+
27+
</div>
28+
29+
</main>
Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
---
2-
layout: layouts/base.vto
3-
---
4-
5-
<main id="articles">
6-
7-
<a href="..">back</a>
8-
<header>
9-
<h1>{{page.data.title}}</h1>
10-
<p>created {{page.data.date |> date()}}</p>
11-
12-
</header>
13-
<article>
14-
{{content}}
15-
</article>
16-
</main>
1+
---
2+
layout: layouts/base.vto
3+
---
4+
5+
<main id="articles">
6+
7+
<a href="..">back</a>
8+
<header>
9+
<h1>{{page.data.title}}</h1>
10+
<p>created {{page.data.date |> date()}}</p>
11+
12+
</header>
13+
<article>
14+
{{content}}
15+
</article>
16+
</main>

src/index.vto

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
---
2-
layout: layouts/base.vto
3-
---
4-
5-
<main id="index">
6-
7-
<p>proxyerium::home <i>powered by deno lume</i></p>
8-
9-
<a href="p">posts</a>
10-
</main>
1+
---
2+
layout: layouts/base.vto
3+
---
4+
5+
<main id="index">
6+
7+
<p>proxyerium::home <i>powered by deno lume</i></p>
8+
9+
<a href="p">posts</a>
10+
</main>

src/posts.page.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
export const layout = 'layouts/lists.vto';
2-
3-
export default function* ({ search, paginate }) {
4-
const posts = search.pages('type=posts', 'date=desc');
5-
const options = {
6-
url: (n) => (n === 1 ? '/p/' : `/p/${n}/`),
7-
size: 10,
8-
};
9-
10-
for (const pages of paginate(posts, options)) {
11-
yield pages;
12-
}
13-
}
1+
export const layout = 'layouts/lists.vto';
2+
3+
export default function* ({ search, paginate }) {
4+
const posts = search.pages('type=posts', 'date=desc');
5+
const options = {
6+
url: (n) => (n === 1 ? '/p/' : `/p/${n}/`),
7+
size: 10,
8+
};
9+
10+
for (const pages of paginate(posts, options)) {
11+
yield pages;
12+
}
13+
}

0 commit comments

Comments
 (0)