-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsmith.ts
More file actions
36 lines (30 loc) · 894 Bytes
/
smith.ts
File metadata and controls
36 lines (30 loc) · 894 Bytes
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
import { dirname } from 'node:path'
import { fileURLToPath } from 'node:url'
import layouts from '@metalsmith/layouts'
import { blueprint, getHandlebarsPartials } from '@seamapi/smith'
import * as types from '@seamapi/types/connect'
import { deleteAsync } from 'del'
import Metalsmith from 'metalsmith'
import { connect, helpers } from './lib/index.js'
const rootDir = dirname(fileURLToPath(import.meta.url))
await Promise.all([deleteAsync('./src/lib/seam/connect/routes')])
const partials = await getHandlebarsPartials(`${rootDir}/layouts/partials`)
Metalsmith(rootDir)
.source('./content')
.destination('../')
.clean(false)
.use(blueprint({ types }))
.use(connect)
.use(
layouts({
default: 'default.hbs',
engineOptions: {
noEscape: true,
helpers,
partials,
},
}),
)
.build((err) => {
if (err != null) throw err
})