Skip to main content

Site customisations

This page lists the site's custom components, theme overrides, and plugins.

Custom Components​

Home Page Components​

The home page is defined in src/pages/index.tsx, with its layout and card styles in src/pages/index.module.scss. The curated links, topic cards, and contribution links are maintained there. The older Homepage* components in src/components/ are not used by the current home page.

Shared colours, typography, navigation, and light/dark styling are defined in src/scss/_community-theme.scss, loaded by src/scss/custom.scss. The repository README also covers the logo and social share image.

Documented Components​

The components described in the knowledge base live in src/components/. Their guides include usage examples and link to the source files.

DocusaurusButton​

DocusaurusButton links to Docusaurus documentation. Its source is src/components/DocusaurusButton/index.tsx.

Swizzled Components​

Admonition​

The site overrides Docusaurus's Admonition component in src/theme/Admonition/. See the knowledge base guide to customising admonitions.

DocItem/Footer​

The wrapper in src/theme/DocItem/Footer/index.tsx keeps the standard Docusaurus document footer and adds a contributor list. Its helper components fetch contributors from the document's GitHub commit history and include any additionalContributors from frontmatter. This is inspired by the unleash team who added contributors to their documentation.

The component in src/theme/Logo/index.tsx renders the community mark and two-tone wordmark in the navbar and mobile menu. The logo assets and their light/dark variants are configured in docusaurus.config.ts.

Custom Plugins​

Plugin Directory​

The plugin directory is powered by @homotechsual/docusaurus-plugin-showcase. Each plugin is defined as a YAML file in data/plugins/. See Adding a Plugin for how to submit a new entry.

Custom Frontmatter​

To support our contributor display on docs pages we sometimes use a custom frontmatter field called additionalContributors. This field is used to display additional contributors to a document. It is an array of objects with the following structure:

type AdditionalContributor = {
login: string;
html_url: string;
avatar_url: string;
};

An example of how this is used in a document is:

---
title: Site customisations
description: Components, theme overrides, and plugins maintained in this repository.
additionalContributors:
- login: github-bot
html_url: https://github.com/github-bot
avatar_url: https://avatars.githubusercontent.com/u/6031226?v=4
---