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