Files
yoga/website/docusaurus.config.js
Nick Gerleman 1f7faf4c61 Make documentation embeds less ugly (#1670)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1670

Embeds to Yoga's documentation reuse a tiny rasterized favicon, blown up, and full of jpeg artifacts.

{F1714492025}

This bothered me enough to make the previews look better.

This change adds a quickly whipped up opengraph sized image, replaces the favicon with one derived from logo SVG, and fixes a missing description on the homepage.

 {F1714566402}

Reviewed By: yungsters

Differential Revision: D58923501

fbshipit-source-id: 249a23034f50667e32970121a90eccc380e566a3
2024-06-24 07:38:05 -07:00

114 lines
2.8 KiB
JavaScript

/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// @ts-check
import {themes as prismThemes} from 'prism-react-renderer';
/** @type {import('@docusaurus/types').Config} */
export default {
title: 'Yoga',
tagline:
'Build flexible layouts on any platform with a highly optimized open source layout engine designed with speed, size, and ease of use in mind.',
favicon: 'img/favicon.svg',
url: 'https:/yogalayout.dev',
baseUrl: '/',
organizationName: 'facebook',
projectName: 'yoga',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
i18n: {
defaultLocale: 'en',
locales: ['en'],
},
presets: [
[
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
sidebarPath: require.resolve('./sidebars.cjs'),
editUrl: 'https://github.com/facebook/yoga/tree/main/website',
},
blog: {
showReadingTime: true,
editUrl: 'https://github.com/facebook/yoga/tree/main/website',
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
}),
],
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
navbar: {
title: 'Yoga',
logo: {
alt: 'Yoga Logo',
src: 'img/logo.svg',
},
items: [
{
type: 'docSidebar',
sidebarId: 'docsSidebar',
position: 'left',
label: 'Documentation',
},
{to: '/playground', label: 'Playground', position: 'left'},
{to: '/blog', label: 'Blog', position: 'left'},
{
href: 'https://github.com/facebook/yoga',
label: 'GitHub',
position: 'right',
},
],
},
footer: {
style: 'dark',
logo: {
alt: 'Meta Open Source',
src: 'img/meta_oss.svg',
href: 'https://opensource.fb.com',
width: 300,
height: 64,
},
copyright: `Copyright © ${new Date().getFullYear()} Meta Platforms, Inc.`,
},
prism: {
theme: prismThemes.github,
darkTheme: prismThemes.oneDark,
additionalLanguages: ['gradle', 'java', 'json', 'json5', 'ruby'],
},
colorMode: {
defaultMode: 'dark',
respectPrefersColorScheme: true,
},
metadata: [
{
property: 'og:image',
content: 'https://yogalayout.dev/img/opengraph.png',
},
{
property: 'og:image:width',
content: '1200',
},
{
property: 'og:image:height',
content: '630',
},
],
}),
};