feat: logo and open graph
Some checks failed
Code Analysis / SonarQube (push) Failing after 16s
Node.js CI / Lint and Test (push) Successful in 52s

This commit is contained in:
2025-06-12 15:55:00 -07:00
parent 49dd426ed9
commit c461453342
3 changed files with 90 additions and 74 deletions

View File

@ -1,28 +1,34 @@
import { defineConfig } from 'astro/config'; import { defineConfig } from "astro/config";
import starlight from "@astrojs/starlight"; import starlight from "@astrojs/starlight";
import { ExpressiveCodeTheme } from "@astrojs/starlight/expressive-code" import { ExpressiveCodeTheme } from "@astrojs/starlight/expressive-code";
import themeJson from "./src/styles/theme.json" import themeJson from "./src/styles/theme.json";
import darkThemeJson from "./src/styles/theme-dark.json" import darkThemeJson from "./src/styles/theme-dark.json";
import { navigation } from "./src/components/navigation.ts"; import { navigation } from "./src/components/navigation.ts";
const sakuraDreams = ExpressiveCodeTheme.fromJSONString(JSON.stringify(themeJson)); const sakuraDreams = ExpressiveCodeTheme.fromJSONString(
const sakuraDreamsDark = ExpressiveCodeTheme.fromJSONString(JSON.stringify(darkThemeJson)); JSON.stringify(themeJson)
);
const sakuraDreamsDark = ExpressiveCodeTheme.fromJSONString(
JSON.stringify(darkThemeJson)
);
export default defineConfig({ export default defineConfig({
site: "https://docs.nhcarrigan.com", site: "https://docs.nhcarrigan.com",
integrations: [starlight({ integrations: [
starlight({
components: { components: {
Footer: "./src/components/Footer.astro", Footer: "./src/components/Footer.astro",
ThemeProvider: "./src/components/ThemeProvider.astro", ThemeProvider: "./src/components/ThemeProvider.astro",
}, },
title: "NHCarrigan Docs", title: "NHCarrigan Docs",
sidebar: navigation, sidebar: navigation,
tableOfContents: { minHeadingLevel: 2, maxHeadingLevel: 4}, tableOfContents: { minHeadingLevel: 2, maxHeadingLevel: 4 },
description: "This site contains all of the documentation related to NHCarrigan, its Policies, and its Projects.", description:
"This site contains all of the documentation related to NHCarrigan, its Policies, and its Projects.",
editLink: { editLink: {
baseUrl: "https://git.nhcarrigan.com/nhcarrigan/docs/_edit/main/", baseUrl: "https://git.nhcarrigan.com/nhcarrigan/docs/_edit/main/",
label: "Edit this page on Naomi's Self-hosted Git instance" label: "Edit this page on Naomi's Self-hosted Git instance",
}, },
lastUpdated: true, lastUpdated: true,
social: { social: {
@ -31,7 +37,12 @@ export default defineConfig({
mastodon: "https://fedi.nhcarrigan.com/@naomi", mastodon: "https://fedi.nhcarrigan.com/@naomi",
matrix: "https://matrix.nhcarrigan.com", matrix: "https://matrix.nhcarrigan.com",
rss: "https://irc.nhcarrigan.com", rss: "https://irc.nhcarrigan.com",
email: "mailto:contact@nhcarrigan.com" email: "mailto:contact@nhcarrigan.com",
},
logo: {
src: "./public/logo.png",
alt: "NHCarrigan Logo",
replacesTitle: true
}, },
head: [ head: [
{ {
@ -43,11 +54,12 @@ export default defineConfig({
defer: true, defer: true,
"data-domain": "nhcarrigan.com", "data-domain": "nhcarrigan.com",
"event-domain": "docs.nhcarrigan.com", "event-domain": "docs.nhcarrigan.com",
} },
}, },
{ {
tag: "script", tag: "script",
content: "window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) }" content:
"window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) }",
}, },
{ {
tag: "script", tag: "script",
@ -55,15 +67,15 @@ export default defineConfig({
type: "text/javascript", type: "text/javascript",
id: "trees", id: "trees",
src: "https://widgets.tree-nation.com/js/widgets/v1/widgets.min.js?v=1.0", src: "https://widgets.tree-nation.com/js/widgets/v1/widgets.min.js?v=1.0",
defer: true defer: true,
} },
}, },
{ {
tag: "link", tag: "link",
attrs: { attrs: {
rel: "icon", rel: "icon",
href: "/logo.png" href: "./public/logo.png",
} },
}, },
{ {
tag: "script", tag: "script",
@ -71,17 +83,21 @@ export default defineConfig({
type: "text/javascript", type: "text/javascript",
src: "https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-3569924701890974", src: "https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-3569924701890974",
async: true, async: true,
crossorigin: "anonymous" crossorigin: "anonymous",
},
},
{
tag: "meta",
attrs: {
property: "og:image",
content: "https://cdn.nhcarrigan.com/og-image.png"
} }
} }
], ],
customCss: [ customCss: ["./src/styles/style.css", "./src/fonts/font-face.css"],
"./src/styles/style.css",
"./src/fonts/font-face.css"
],
expressiveCode: { expressiveCode: {
themes: [sakuraDreams, sakuraDreamsDark], themes: [sakuraDreams, sakuraDreamsDark],
} },
}), }),
] ],
}); });

Binary file not shown.

Before

Width:  |  Height:  |  Size: 112 KiB

After

Width:  |  Height:  |  Size: 1.0 MiB

BIN
public/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB