docs/docusaurus.config.js

175 lines
4.3 KiB
JavaScript

// @ts-check
const isCI = process.env.CI === "true";
const isPreview = process.env.DEPLOY_PREVIEW === "true";
/** @type {import("@docusaurus/types").Config} */
const base = {
title: "Lethal-Extended Documentation",
tagline: "Documentation for Lethal-Extended devs",
customFields: {
description:
"Documentation for all projects under the Extended umbrella.",
},
url: isPreview ? process.env.PREVIEW_URL : "https://docs.lethal-extended.com",
baseUrl: isPreview ? process.env.PREVIEW_BASE_URL : "/",
onBrokenLinks: isCI ? "throw" : "warn",
onBrokenMarkdownLinks: isCI ? "throw" : "warn",
onDuplicateRoutes: isCI ? "throw" : "error",
favicon: "img/favicon.ico",
organizationName: "Lethal-Extended",
projectName: "docs",
trailingSlash: false,
noIndex: isPreview,
presets: [
[
"classic",
/** @type {import("@docusaurus/preset-classic").Options} */
({
debug: !isCI || isPreview,
theme: {
customCss: [require.resolve("./src/css/custom.css")],
},
docs: {
editUrl: ({ docPath }) => `#`,
showLastUpdateAuthor: true,
showLastUpdateTime: true,
sidebarCollapsible: true,
remarkPlugins: [require("@fec/remark-a11y-emoji")],
routeBasePath: "/",
sidebarPath: require.resolve("./sidebars.js"),
},
blog: false,
}),
],
],
plugins: [
[
"@docusaurus/plugin-pwa",
{
offlineModeActivationStrategies: ["appInstalled", "standalone", "queryString"],
pwaHead: [
{
tagName: "link",
rel: "icon",
href: "img/logo.png",
},
{
tagName: "link",
rel: "manifest",
href: "/manifest.json",
},
{
tagName: "meta",
name: "theme-color",
content: "rgb(0, 78, 233)",
},
],
},
],
],
themeConfig:
/** @type {import("@docusaurus/preset-classic").ThemeConfig} */
({
colorMode: {
respectPrefersColorScheme: true,
},
image: "img/logo.png",
metadata: [
{
name: "twitter:card",
content: "summary",
},
{
name: "og:type",
content: "website",
},
{
name: "og:image:alt",
content: "LE Logo",
},
],
navbar: {
title: "Lethal-Extended Docs",
logo: {
alt: "LE Logo",
src: "img/logo.png",
},
items: [
{
to: "https://lethal-extended.com/branches.html",
label: "Downloads",
position: "right",
},
{
href: "https://discord.gg/BkmEarDQxq",
className: "header-icon-link header-discord-link",
position: "right",
},
{
href: "https://gitea.pengucc.com/Lethal-Extended/",
className: "header-icon-link header-github-link",
position: "right",
},
],
},
footer: {
style: "dark",
links: [
{
title: "Community",
items: [
{
label: "Discord",
href: "https://discord.gg/BkmEarDQxq",
},
],
},
{
title: "Other",
items: [
{
label: "Main Site",
href: "https://lethal-extended.com",
},
{
label: "GitHub",
href: "https://gitea.pengucc.com/Lethal-Extended/",
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} Lethal-Extended and Contributors`,
},
prism: {
additionalLanguages: [
"batch",
"bash",
"git",
"java",
"javastacktrace",
"kotlin",
"groovy",
"log",
"toml",
"properties",
],
theme: require("prism-react-renderer/themes/vsDark"),
},
algolia: {
appId: "P1BCDPTG1Q",
apiKey: "34772712950f27c6e9c714ad2e6c5e16",
indexName: "docs-papermc",
},
}),
};
async function config() {
return base;
}
module.exports = config;