This repository has been archived by the owner on Feb 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
_config.ts
48 lines (43 loc) · 1.31 KB
/
_config.ts
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
import lume from 'lume/mod.ts'
import inline from 'lume/plugins/inline.ts'
import postcss from 'lume/plugins/postcss.ts'
import esbuild from 'lume/plugins/esbuild.ts'
import remark from './modules/remark/mod.ts'
import rehypePlugins from './modules/rehype/plugins.ts'
import remarkPlugins from './modules/remark/plugins.ts'
import feed from './modules/feed/mod.ts'
import sitemap from './modules/sitemap/mod.ts'
import postcssPlugins from './modules/postcss/plugins.ts'
import { csso, dayjs } from './deps.ts'
import data from './src/_data.ts'
const site = lume({
src: './src',
dest: './dist',
location: new URL(data.app.url),
server: {
port: 8080
}
})
site.use(dayjs({
unit: 'year',
precisionMode: true
}))
site.use(inline())
site.use(remark({
remarkPlugins: remarkPlugins,
rehypePlugins: rehypePlugins
}))
site.use(postcss({
plugins: postcssPlugins
}))
site.use(csso())
site.use(esbuild())
site.loadData(['.md'])
site.copy('assets', '.')
site.copy('assets/_headers', '_headers')
site.copy('assets/_redirects', '_redirects')
site.filter('source', (path) => new URL(data.app.repositoryContext + path).href)
site.filter('capitalize', ([ first, ...rest ]) => [first.toUpperCase(), ...rest].join(''))
site.filter('feed', (feedOptions) => feed(feedOptions))
site.filter('sitemap', (urls) => sitemap(urls))
export default site