3
3
const lightTheme = require ( './src/utils/prismLight.js' ) ;
4
4
const darkTheme = require ( './src/utils/prismDark.js' ) ;
5
5
6
+ const title = 'Spectacle' ;
7
+ const subtitle = `${ title } - React library for sleek presentations, using JSX syntax` ;
8
+ const tagline =
9
+ 'A React.js based library for creating sleek presentations using JSX syntax that gives you the ability to live demo your code.' ;
10
+
6
11
async function createConfig ( ) {
7
12
/** @type {import("@docusaurus/types").Config } */
8
13
const config = {
9
- title : 'Spectacle' ,
10
- tagline :
11
- 'A React.js based library for creating sleek presentations using JSX syntax that gives you the ability to live demo your code.' ,
14
+ title,
15
+ tagline,
12
16
url : 'https://commerce.nearform.com/' ,
13
17
baseUrl :
14
18
process . env . VERCEL_ENV === 'preview' ? '/' : '/open-source/spectacle' ,
@@ -17,7 +21,6 @@ async function createConfig() {
17
21
favicon : 'img/favicon.ico' ,
18
22
organizationName : 'Nearform Commerce' ,
19
23
projectName : 'spectacle' ,
20
-
21
24
presets : [
22
25
[
23
26
'@docusaurus/preset-classic' ,
@@ -57,7 +60,6 @@ async function createConfig() {
57
60
} )
58
61
]
59
62
] ,
60
-
61
63
plugins : [
62
64
'docusaurus-plugin-sass' ,
63
65
[
@@ -72,7 +74,6 @@ async function createConfig() {
72
74
}
73
75
]
74
76
] ,
75
-
76
77
themeConfig :
77
78
/** @type {import("@docusaurus/preset-classic").ThemeConfig } */
78
79
( {
@@ -115,7 +116,59 @@ async function createConfig() {
115
116
} ,
116
117
copyright : `Copyright © ${ new Date ( ) . getFullYear ( ) } Nearform`
117
118
} ,
118
- prism : { } // Keep empty object so we can add prism themes below
119
+ prism : { } , // Keep empty object so we can add prism themes below
120
+ metadata : [
121
+ {
122
+ name : 'title' ,
123
+ content : subtitle
124
+ } ,
125
+ {
126
+ name : 'description' ,
127
+ content : tagline
128
+ } ,
129
+ {
130
+ name : 'viewport' ,
131
+ content : 'width=device-width, initial-scale=1, maximum-scale=1'
132
+ } ,
133
+ {
134
+ property : 'og:type' ,
135
+ content : 'website'
136
+ } ,
137
+ {
138
+ property : 'og:url' ,
139
+ content : 'https://commerce.nearform.com/open-source/spectacle/'
140
+ } ,
141
+ {
142
+ property : 'og:title' ,
143
+ content : subtitle
144
+ } ,
145
+ {
146
+ property : 'og:description' ,
147
+ content : tagline
148
+ } ,
149
+ {
150
+ property : 'og:image' ,
151
+ content :
152
+ 'https://commerce.nearform.com/open-source/spectacle/open-graph.png'
153
+ } ,
154
+ {
155
+ property : 'twitter:card' ,
156
+ content : 'summary_large_image'
157
+ } ,
158
+ {
159
+ property : 'twitter:title' ,
160
+ content : subtitle
161
+ } ,
162
+ {
163
+ property : 'twitter:description' ,
164
+ content : tagline
165
+ } ,
166
+ {
167
+ property : 'twitter:image' ,
168
+ content :
169
+ 'https://commerce.nearform.com/open-source/spectacle/open-graph.png'
170
+ }
171
+ ]
119
172
} )
120
173
} ;
121
174
@@ -125,5 +178,4 @@ async function createConfig() {
125
178
config . themeConfig . prism . darkTheme = darkTheme ;
126
179
return config ;
127
180
}
128
-
129
181
module . exports = createConfig ;
0 commit comments