Skip to content

Commit 9bb783a

Browse files
updated docusaurus config with open-graph image and metadata
1 parent 07667fc commit 9bb783a

File tree

1 file changed

+60
-10
lines changed

1 file changed

+60
-10
lines changed

website/docusaurus.config.js

+60-10
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
// @ts-check
2-
// Note: type annotations allow type checking and IDEs autocompletion
31
const lightTheme = require('./src/utils/prismLight.js');
42
const darkTheme = require('./src/utils/prismDark.js');
53

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+
69
async function createConfig() {
710
/** @type {import("@docusaurus/types").Config} */
811
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,
1214
url: 'https://commerce.nearform.com/',
1315
baseUrl:
1416
process.env.VERCEL_ENV === 'preview' ? '/' : '/open-source/spectacle',
@@ -17,7 +19,6 @@ async function createConfig() {
1719
favicon: 'img/favicon.ico',
1820
organizationName: 'Nearform Commerce',
1921
projectName: 'spectacle',
20-
2122
presets: [
2223
[
2324
'@docusaurus/preset-classic',
@@ -57,7 +58,6 @@ async function createConfig() {
5758
})
5859
]
5960
],
60-
6161
plugins: [
6262
'docusaurus-plugin-sass',
6363
[
@@ -72,7 +72,6 @@ async function createConfig() {
7272
}
7373
]
7474
],
75-
7675
themeConfig:
7776
/** @type {import("@docusaurus/preset-classic").ThemeConfig} */
7877
({
@@ -115,7 +114,59 @@ async function createConfig() {
115114
},
116115
copyright: `Copyright © ${new Date().getFullYear()} Nearform`
117116
},
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+
]
119170
})
120171
};
121172

@@ -125,5 +176,4 @@ async function createConfig() {
125176
config.themeConfig.prism.darkTheme = darkTheme;
126177
return config;
127178
}
128-
129179
module.exports = createConfig;

0 commit comments

Comments
 (0)