mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
104 lines
3.4 KiB
JavaScript
104 lines
3.4 KiB
JavaScript
import { defineConfig } from "astro/config";
|
|
import starlight from "@astrojs/starlight";
|
|
|
|
import { generateSchema } from "./src/schema_generator";
|
|
|
|
const url = "https://nh.outerwildsmods.com";
|
|
|
|
generateSchema("body_schema.json");
|
|
generateSchema("star_system_schema.json");
|
|
generateSchema("translation_schema.json");
|
|
generateSchema("addon_manifest_schema.json");
|
|
generateSchema("dialogue_schema.xsd");
|
|
generateSchema("text_schema.xsd");
|
|
generateSchema("shiplog_schema.xsd");
|
|
|
|
const ogMeta = (name, val) => ({
|
|
tag: "meta",
|
|
attrs: {
|
|
property: `og:${name}`,
|
|
content: val
|
|
}
|
|
});
|
|
|
|
const twMeta = (name, val) => ({
|
|
tag: "meta",
|
|
attrs: {
|
|
name: `twitter:${name}`,
|
|
content: val
|
|
}
|
|
});
|
|
|
|
// https://astro.build/config
|
|
export default defineConfig({
|
|
site: url,
|
|
compressHTML: true,
|
|
integrations: [
|
|
starlight({
|
|
title: "New Horizons",
|
|
description:
|
|
"Documentation on how to use the New Horizons planet creation tool for Outer Wilds.",
|
|
defaultLocale: "en-us",
|
|
favicon: "/favicon.png",
|
|
components: {
|
|
PageSidebar: "/src/components/ConditionalPageSidebar.astro"
|
|
},
|
|
customCss: ["/src/styles/custom.css"],
|
|
logo: {
|
|
src: "/src/assets/icon.webp",
|
|
alt: "The New Horizons Logo"
|
|
},
|
|
social: {
|
|
github: "https://github.com/Outer-Wilds-New-Horizons/new-horizons",
|
|
discord: "https://discord.gg/wusTQYbYTc"
|
|
},
|
|
head: [
|
|
ogMeta("image", `${url}/og_image.webp`),
|
|
ogMeta("image:width", "1200"),
|
|
ogMeta("image:height", "400"),
|
|
twMeta("card", "summary"),
|
|
twMeta("image", `${url}/og_image.webp`),
|
|
{ tag: "meta", attrs: { name: "theme-color", content: "#ffab8a" } }
|
|
],
|
|
sidebar: [
|
|
{
|
|
label: "Start Here",
|
|
autogenerate: {
|
|
directory: "start-here"
|
|
}
|
|
},
|
|
{
|
|
label: "Guides",
|
|
autogenerate: {
|
|
directory: "guides"
|
|
}
|
|
},
|
|
{
|
|
label: "Schemas",
|
|
items: [
|
|
{ label: "Celestial Body Schema", link: "schemas/body-schema" },
|
|
{ label: "Star System Schema", link: "schemas/star-system-schema" },
|
|
{ label: "Translation Schema", link: "schemas/translation-schema" },
|
|
{ label: "Addon Manifest Schema", link: "schemas/addon-manifest-schema" },
|
|
{ label: "Dialogue Schema", link: "schemas/dialogue-schema" },
|
|
{ label: "Text Schema", link: "schemas/text-schema" },
|
|
{ label: "Ship Log Schema", link: "schemas/shiplog-schema" }
|
|
]
|
|
},
|
|
{
|
|
label: "Reference",
|
|
autogenerate: {
|
|
directory: "reference"
|
|
}
|
|
}
|
|
]
|
|
})
|
|
],
|
|
// Process images with sharp: https://docs.astro.build/en/guides/assets/#using-sharp
|
|
image: {
|
|
service: {
|
|
entrypoint: "astro/assets/services/sharp"
|
|
}
|
|
}
|
|
});
|