This repository was archived by the owner on Sep 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
106 lines (99 loc) · 2.92 KB
/
index.js
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
const pick = require("lodash.pick");
module.exports = themeConfig => {
themeConfig = Object.assign(themeConfig, {
name: themeConfig.name || "Steven Yung",
description:
themeConfig.description ||
"A developer trying to break out of traditional 9-5.",
profile: themeConfig.profile || "/profile.jpg",
dateFormat: themeConfig.dateForm || "MMMM DD, YYYY",
socialLinks: themeConfig.socialLinks || [
{ url: "https://twitter.com/stvnyung", name: "Twitter" },
{ url: "https://github.com/stvnyung", name: "Github" },
{ url: "https://dev.to/stvnyung", name: "Dev.to" },
{ url: "https://www.instagram.com/stvn.yung/", name: "Instagram" }
],
newsletterEndpoint: themeConfig.newsletterEndpoint || null,
newsletterContent: themeConfig.newsletterContent || null,
googleAnalyticsId: themeConfig.googleAnalyticsId || null
});
const defaultBlogPluginOptions = {
directories: [
{
id: "post",
dirname: "_posts",
path: "/",
itemPermalink: "/:slug"
}
]
};
// const properties = ["name", "description", "profile", "socialLinks"];
// const themeConfigPluginOptions = {
// ...pick(themeConfig, properties)
// };
const blogPluginOptions = Object.assign({}, defaultBlogPluginOptions, {
themeConfig
});
const plugins = [
["@vuepress/blog", blogPluginOptions],
...(process.env.NODE_ENV === "production" && themeConfig.googleAnalyticsId
? [
[
"@vuepress/google-analytics",
{
ga: themeConfig.googleAnalyticsId
}
]
]
: []),
...(themeConfig.newsletterEndpoint
? [
[
"vuepress-plugin-mailchimp",
{
// You need to provide this plugin with your Mailchimp endpoint in order for it
// to know where to save the email address. See more detail in Config section.
endpoint: themeConfig.newsletterEndpoint,
content: themeConfig.newsletterContent
}
]
]
: [])
];
const config = {
plugins
};
return config;
};
// module.exports = {
// plugins: [
// [
// "@vuepress/blog",
// {
// directories: [
// {
// id: "post",
// dirname: "_posts",
// path: "/",
// itemPermalink: "/:slug"
// }
// ]
// }
// ],
// [
// "@vuepress/google-analytics",
// {
// ga: "UA-135207098-1"
// }
// ],
// [
// "vuepress-plugin-mailchimp",
// {
// // You need to provide this plugin with your Mailchimp endpoint in order for it
// // to know where to save the email address. See more detail in Config section.
// endpoint:
// "https://icloud.us20.list-manage.com/subscribe/post?u=b334cab704e8cf9d86349a6c1&id=27383beab6"
// }
// ]
// ]
// };