mirror of
https://github.com/sern-handler/website
synced 2026-06-28 02:32:23 +00:00
feat: add VALIDATE_LINKS env argument
This commit is contained in:
4
.env.example
Normal file
4
.env.example
Normal file
@@ -0,0 +1,4 @@
|
||||
# Set this to `true` to enable link validation, useful for development build to make sure all links are valid
|
||||
# Broken since API routes generate links that are relative, so you can only validate links in development
|
||||
# (You can ignore any errors that are generated by the API routes)
|
||||
VALIDATE_LINKS=boolean
|
||||
@@ -4,8 +4,12 @@ import starlightBlog from "starlight-blog";
|
||||
import tailwind from "@astrojs/tailwind";
|
||||
import starlightTypeDoc, { typeDocSidebarGroup } from "starlight-typedoc";
|
||||
import lunaria from "@lunariajs/starlight";
|
||||
import { loadEnv } from "vite";
|
||||
import { GITHUB_URL, DISCORD_URL } from "./src/utils/consts";
|
||||
// import starlightLinksValidator from 'starlight-links-validator';
|
||||
import starlightLinksValidator from 'starlight-links-validator';
|
||||
|
||||
const { VALIDATE_LINKS } = loadEnv(process.env.NODE_ENV, process.cwd(), "");
|
||||
const validateLinks = VALIDATE_LINKS === "true";
|
||||
|
||||
export default defineConfig({
|
||||
integrations: [
|
||||
@@ -130,11 +134,10 @@ export default defineConfig({
|
||||
sidebar: { collapsed: true },
|
||||
}),
|
||||
lunaria(),
|
||||
// Uncomment to enable links validation when building locally; netlify crashes for API routes
|
||||
// starlightLinksValidator({
|
||||
// exclude: ['/plugins'],
|
||||
// }),
|
||||
],
|
||||
validateLinks ? starlightLinksValidator({
|
||||
exclude: ['/plugins'],
|
||||
}) : null,
|
||||
].filter(Boolean),
|
||||
}),
|
||||
tailwind(),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user