Skip to content

Commit 45d8d39

Browse files
committed
refactor: update config
1 parent 84002a9 commit 45d8d39

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

_config.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,23 @@ import blog from 'blog/mod.ts'
33

44
export default lume({
55
src: './src',
6-
}).use(blog())
6+
})
7+
.use(blog())
8+
// remove /posts prefix
9+
// https://lume.land/docs/core/processors/#preprocess
10+
.preprocess(['.html'], pages => {
11+
for (const page of pages) {
12+
if (page.data.url.startsWith('/posts')) {
13+
page.data.url = page.data.url.slice('/posts'.length)
14+
}
15+
}
16+
})
17+
// remove author page
18+
// https://lume.land/docs/core/processors/#remove-pages-dynamically
19+
.process(['.html'], (filteredPages, allPages) => {
20+
for (const page of filteredPages) {
21+
if (page.data.url.startsWith('/author')) {
22+
allPages.splice(allPages.indexOf(page), 1)
23+
}
24+
}
25+
})

0 commit comments

Comments
 (0)