-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgridsome.config.js
115 lines (109 loc) · 2.89 KB
/
gridsome.config.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
107
108
109
110
111
112
113
114
115
const path = require("path");
const marked = require("marked");
function addStyleResource(rule) {
rule
.use("style-resource")
.loader("style-resources-loader")
.options({
patterns: [
path.resolve(__dirname, "./src/assets/styles/base/_variables.scss"),
// you can also use a glob if you'd prefer
//path.resolve(__dirname, './src/assets/styles/**/*.scss'),
],
});
}
module.exports = {
siteName: "AppVenture",
icon: "src/assets/favicon.png",
plugins: [
{ use: "gridsome-plugin-typescript" },
{
use: "@gridsome/source-filesystem",
options: {
typeName: "BlogPost",
path: "content/blog/**/*.md",
refs: {
author: "Contributor",
tags: "Tag",
},
remark: {
plugins: [
["@gridsome/remark-prismjs", { transformInlineCode: true }],
"gridsome-remark-katex",
"remark-attr",
],
},
},
},
{
use: "@gridsome/source-filesystem",
options: {
typeName: "Event",
path: "content/events/**/*.yaml",
refs: {
tags: "Tag",
},
},
},
{
use: "@gridsome/source-filesystem",
options: {
typeName: "Project",
path: "content/projects/**/*.yaml",
refs: {
tags: "Tag",
allContributors: "Contributor",
},
},
},
{
use: "gridsome-plugin-rss",
options: {
contentTypeName: "BlogPost",
latest: true,
maxItems: 20,
feedOptions: {
title: "nush.app Blogposts",
description:
"Featuring student-written articles on programming and internal events",
feed_url: "https://nush.app/rss.xml",
site_url: "https://nush.app",
language: "en",
},
feedItemOptions: (node) => {
const url = `https://nush.app/blog/${node.date.getFullYear()}/${String(
node.date.getMonth() + 1,
).padStart(2, "0")}/${String(node.date.getDate()).padStart(2, "0")}/${
node.slug
}`;
return {
title: node.title,
description: marked.parse(node.content),
url: url,
author: node.author.map((x) => x.name)[0],
date: node.date,
category: node.tags.map((x) => x.name),
};
},
output: {
dir: "./dist",
name: "rss.xml",
},
},
},
],
templates: {
BlogPost: "/blog/:year/:month/:day/:slug",
Contributor: "/contributor/:id",
Event: "/events/:id",
Project: "/projects/:id",
},
chainWebpack(config) {
// Load variables for all vue-files
const types = ["vue-modules", "vue", "normal-modules", "normal"];
// or if you use scss
types.forEach((type) => {
addStyleResource(config.module.rule("scss").oneOf(type));
});
},
};