33const lightTheme = require ( './src/utils/prismLight.js' ) ;
44const darkTheme = require ( './src/utils/prismDark.js' ) ;
55
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+
611async function createConfig ( ) {
712 /** @type {import("@docusaurus/types").Config } */
813 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,
1216 url : 'https://commerce.nearform.com/' ,
1317 baseUrl :
1418 process . env . VERCEL_ENV === 'preview' ? '/' : '/open-source/spectacle' ,
@@ -17,7 +21,6 @@ async function createConfig() {
1721 favicon : 'img/favicon.ico' ,
1822 organizationName : 'Nearform Commerce' ,
1923 projectName : 'spectacle' ,
20-
2124 presets : [
2225 [
2326 '@docusaurus/preset-classic' ,
@@ -57,7 +60,6 @@ async function createConfig() {
5760 } )
5861 ]
5962 ] ,
60-
6163 plugins : [
6264 'docusaurus-plugin-sass' ,
6365 [
@@ -72,7 +74,6 @@ async function createConfig() {
7274 }
7375 ]
7476 ] ,
75-
7677 themeConfig :
7778 /** @type {import("@docusaurus/preset-classic").ThemeConfig } */
7879 ( {
@@ -115,7 +116,59 @@ async function createConfig() {
115116 } ,
116117 copyright : `Copyright © ${ new Date ( ) . getFullYear ( ) } Nearform`
117118 } ,
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+ ]
119172 } )
120173 } ;
121174
@@ -125,5 +178,4 @@ async function createConfig() {
125178 config . themeConfig . prism . darkTheme = darkTheme ;
126179 return config ;
127180}
128-
129181module . exports = createConfig ;
0 commit comments