-
Notifications
You must be signed in to change notification settings - Fork 0
/
_config.ts
60 lines (57 loc) · 1.6 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
49
50
51
52
53
54
55
56
57
58
59
60
import lume from "lume/mod.ts";
import postcss from "lume/plugins/postcss.ts";
import esbuild from "lume/plugins/esbuild.ts";
import inline from "lume/plugins/inline.ts";
import multilanguage from "lume/plugins/multilanguage.ts";
import relations from "lume/plugins/relations.ts";
import date from "lume/plugins/date.ts";
import slugifyUrls from "lume/plugins/slugify_urls.ts";
import postcssExtendRule from "npm:[email protected]";
import postcssCustomMedia from "npm:[email protected]";
import gl from "npm:date-fns/locale/gl/index.js";
import es from "npm:date-fns/locale/es/index.js";
const site = lume(
{},
{ search: { returnPageData: true } },
);
site.copy("fonts")
.copy("img")
.copy("files")
.copyRemainingFiles((path) => {
const regexp = /^\/(feet-2010|feed-\d{4}|visita-a-guarda)\//;
return regexp.test(path);
})
.use(inline())
.use(date({
locales: { gl, es },
}))
.use(postcss({
plugins: [
postcssExtendRule(),
postcssCustomMedia(),
],
keepDefaultPlugins: true,
}))
.use(esbuild())
.use(multilanguage({
languages: ["gl", "es"],
defaultLanguage: "gl",
}))
.use(slugifyUrls())
.use(relations({
foreignKeys: {
member: {
foreignKey: "members_id",
relationKey: "member",
pluralRelationKey: "members",
filter: (data1, data2) => data1.lang === data2.lang,
},
portfolio: {
foreignKey: "portfolio_id",
relationKey: "portfolio",
pluralRelationKey: "portfolios",
filter: (data1, data2) => data1.lang === data2.lang,
},
},
}));
export default site;