Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated docusaurus config with open-graph image and metadata #1345

Merged
merged 3 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 60 additions & 10 deletions website/docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
barret-anspach marked this conversation as resolved.
Show resolved Hide resolved
const lightTheme = require('./src/utils/prismLight.js');
const darkTheme = require('./src/utils/prismDark.js');

const title = 'Spectacle';
const subtitle = `${title} - React library for sleek presentations, using JSX syntax`;
const tagline =
'A React.js based library for creating sleek presentations using JSX syntax that gives you the ability to live demo your code.';

async function createConfig() {
/** @type {import("@docusaurus/types").Config} */
const config = {
title: 'Spectacle',
tagline:
'A React.js based library for creating sleek presentations using JSX syntax that gives you the ability to live demo your code.',
title,
tagline,
url: 'https://commerce.nearform.com/',
baseUrl:
process.env.VERCEL_ENV === 'preview' ? '/' : '/open-source/spectacle',
Expand All @@ -17,7 +19,6 @@ async function createConfig() {
favicon: 'img/favicon.ico',
organizationName: 'Nearform Commerce',
projectName: 'spectacle',

presets: [
[
'@docusaurus/preset-classic',
Expand Down Expand Up @@ -57,7 +58,6 @@ async function createConfig() {
})
]
],

plugins: [
'docusaurus-plugin-sass',
[
Expand All @@ -72,7 +72,6 @@ async function createConfig() {
}
]
],

themeConfig:
/** @type {import("@docusaurus/preset-classic").ThemeConfig} */
({
Expand Down Expand Up @@ -115,7 +114,59 @@ async function createConfig() {
},
copyright: `Copyright © ${new Date().getFullYear()} Nearform`
},
prism: {} // Keep empty object so we can add prism themes below
prism: {}, // Keep empty object so we can add prism themes below
metadata: [
{
name: 'title',
content: subtitle
},
{
name: 'description',
content: tagline
},
{
name: 'viewport',
content: 'width=device-width, initial-scale=1, maximum-scale=1'
},
{
property: 'og:type',
content: 'website'
},
{
property: 'og:url',
content: 'https://commerce.nearform.com/open-source/spectacle/'
},
{
property: 'og:title',
content: subtitle
},
{
property: 'og:description',
content: tagline
},
{
property: 'og:image',
content:
'https://commerce.nearform.com/open-source/spectacle/open-graph.png'
},
{
property: 'twitter:card',
content: 'summary_large_image'
},
{
property: 'twitter:title',
content: subtitle
},
{
property: 'twitter:description',
content: tagline
},
{
property: 'twitter:image',
content:
'https://commerce.nearform.com/open-source/spectacle/open-graph.png'
}
]
})
};

Expand All @@ -125,5 +176,4 @@ async function createConfig() {
config.themeConfig.prism.darkTheme = darkTheme;
return config;
}

module.exports = createConfig;
Binary file added website/static/open-graph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading