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
61
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getAlias = void 0;
const path_1 = require("path");
const getAlias = (themeConfig, ctx) => {
const { siteConfig } = ctx;
// Resolve algolia
const isAlgoliaSearch = Boolean(themeConfig.algolia) ||
Object.keys((siteConfig.locales && themeConfig.locales) || {}).some((base) => themeConfig.locales[base].algolia);
const commentEnabled = themeConfig.comment &&
themeConfig.comment.type &&
themeConfig.comment.type !== "disable";
const themeColorEnabled = !(themeConfig.themeColor === false && themeConfig.darkmode === "disable");
const { custom = {} } = themeConfig;
const noopModule = "@mr-hope/vuepress-shared/lib/esm/noopModule";
return {
"@AlgoliaSearchBox": isAlgoliaSearch
? themeConfig.algoliaType === "full"
? (0, path_1.resolve)(__dirname, "../components/AlgoliaSearch/Full.vue")
: (0, path_1.resolve)(__dirname, "../components/AlgoliaSearch/Dropdown.vue")
: noopModule,
"@ContentTop": custom.contentTop
? (0, path_1.resolve)(ctx.sourceDir, ".vuepress", custom.contentTop)
: noopModule,
"@ContentBottom": custom.contentBottom
? (0, path_1.resolve)(ctx.sourceDir, ".vuepress", custom.contentBottom)
: noopModule,
"@PageTop": custom.pageTop
? (0, path_1.resolve)(ctx.sourceDir, ".vuepress", custom.pageTop)
: noopModule,
"@PageBottom": custom.pageBottom
? (0, path_1.resolve)(ctx.sourceDir, ".vuepress", custom.pageBottom)
: noopModule,
"@Comment": commentEnabled
? "@mr-hope/vuepress-plugin-comment/lib/client/Comment.vue"
: noopModule,
"@NavbarStart": custom.navbarStart
? (0, path_1.resolve)(ctx.sourceDir, ".vuepress", custom.navbarStart)
: noopModule,
"@NavbarCenter": custom.navbarCenter
? (0, path_1.resolve)(ctx.sourceDir, ".vuepress", custom.navbarCenter)
: noopModule,
"@NavbarEnd": custom.navbarEnd
? (0, path_1.resolve)(ctx.sourceDir, ".vuepress", custom.navbarEnd)
: noopModule,
"@ThemeColor": themeColorEnabled
? (0, path_1.resolve)(__dirname, "../components/Theme/ThemeColor.vue")
: noopModule,
"@SidebarTop": custom.sidebarTop
? (0, path_1.resolve)(ctx.sourceDir, ".vuepress", custom.sidebarTop)
: noopModule,
"@SidebarCenter": custom.sidebarCenter
? (0, path_1.resolve)(ctx.sourceDir, ".vuepress", custom.sidebarCenter)
: noopModule,
"@SidebarBottom": custom.sidebarBottom
? (0, path_1.resolve)(ctx.sourceDir, ".vuepress", custom.sidebarBottom)
: noopModule,
};
};
exports.getAlias = getAlias;
//# sourceMappingURL=alias.js.map