forked from anmicius0/hsnu.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgatsby-config.js
120 lines (117 loc) · 3.19 KB
/
gatsby-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
116
117
118
119
120
module.exports = {
siteMetadata: {
title: `國立臺灣師範大學附屬高級中學`,
titleTemplate: "%s | hsnu.org",
description: `國立臺灣師範大學附屬高級中學,簡稱為HSNU,是一所位處臺北市大安區信義的高級中學,附屬於國立臺灣師範大學。`,
siteUrl: "https://hsnu.org", // No trailing slash allowed!
image: "https://i.ytimg.com/vi/2fb-g_V-UT4/hqdefault.jpg",
},
plugins: [
`gatsby-plugin-react-helmet`,
"gatsby-plugin-eslint",
`gatsby-plugin-preact`,
`gatsby-plugin-transition-link`,
`gatsby-plugin-sharp`,
`gatsby-transformer-sharp`,
`gatsby-transformer-json`,
// source from WordPress
{
resolve: `gatsby-source-wordpress-experimental`,
options: {
url: process.env.WPGRAPHQL_URL || `https://wordpress.hsnu.org/graphql`,
verbose: true,
develop: {
hardCacheMediaFiles: true,
},
debug: {
graphql: {
writeQueriesToDisk: true,
},
},
type: {
Spost: {
limit:
process.env.NODE_ENV === `development`
? // Lets just pull 50 posts in development to make it easy on ourselves.
50
: // and we don't actually need more than 5000 in production for this particular site
7000,
},
},
},
},
// source from file system
{
resolve: `gatsby-source-filesystem`,
options: {
name: `data`,
path: `${__dirname}/src/data/`,
ignore: [`**/\.*`], // ignore files starting with a dot
},
},
{
resolve: `gatsby-plugin-layout`,
options: {
component: require.resolve(`./src/components/layout/Layout.js`),
},
},
////////////////////////
// SEO!! //
////////////////////////
{
resolve: `gatsby-plugin-manifest`,
options: {
name: `國立臺灣師範大學附屬高級中學`,
short_name: `HSNU`,
start_url: `/`,
background_color: `#ffffff`,
theme_color: `#ffffff`,
display: `standalone`,
icon: `src/images/icons/HSNU.png`,
},
},
`gatsby-plugin-sitemap`,
// canonical link
{
resolve: `gatsby-plugin-canonical-urls`,
options: {
siteUrl: `https://hsnu.org`,
},
},
// robot.txt
{
resolve: "gatsby-plugin-robots-txt",
options: {
host: "https://hsnu.org",
sitemap: "https://hsnu.org/sitemap.xml",
policy: [{ userAgent: "*", allow: "/" }],
},
},
// google tag manager
{
resolve: "gatsby-plugin-google-tagmanager",
options: {
includeInDevelopment: true,
id: "GTM-NZT4RBF",
},
},
// css
// {
// resolve: `gatsby-plugin-prefetch-google-fonts`,
// options: {
// fonts: [
// {
// family: `Noto Sans TC`,
// variants: [`300`, `400`, `700`],
// },
// {
// family: `Noto Serif TC`,
// variants: [`700`],
// },
// ],
// },
// },
`gatsby-plugin-sass`,
`gatsby-plugin-offline`,
],
}