2023-11-12 16:42:57 +00:00
|
|
|
import { defineConfig } from "vitepress";
|
|
|
|
import UnoCSS from "unocss/vite";
|
2023-12-31 11:15:48 +00:00
|
|
|
import consola from "consola";
|
2024-01-04 08:08:55 +00:00
|
|
|
import { commitRef, feedback, meta, search, sidebar, socialLinks } from "./constants";
|
2023-12-31 11:15:48 +00:00
|
|
|
import { generateImages, generateMeta, generateFeed } from "./hooks";
|
2023-11-12 16:42:57 +00:00
|
|
|
import { toggleStarredPlugin } from "./markdown/toggleStarred";
|
|
|
|
import { base64DecodePlugin } from "./markdown/base64";
|
2024-01-24 07:53:57 +00:00
|
|
|
import { movePlugin, emojiRender, defs } from "./markdown/emoji";
|
2023-11-12 16:42:57 +00:00
|
|
|
|
2024-01-24 07:29:55 +00:00
|
|
|
const baseUrl = process.env.GITHUB_ACTIONS ? "/FMHYedit" : "/";
|
2023-11-13 01:54:44 +00:00
|
|
|
export default defineConfig({
|
|
|
|
title: "FMHY",
|
|
|
|
description: meta.description,
|
|
|
|
titleTemplate: ":title • freemediaheckyeah",
|
|
|
|
lang: "en-US",
|
2024-01-24 07:25:45 +00:00
|
|
|
lastUpdated: false,
|
2023-11-13 01:54:44 +00:00
|
|
|
cleanUrls: true,
|
|
|
|
appearance: "dark",
|
2024-01-24 07:29:55 +00:00
|
|
|
base: baseUrl,
|
2023-11-13 01:54:44 +00:00
|
|
|
srcExclude: ["readme.md", "single-page"],
|
|
|
|
ignoreDeadLinks: true,
|
|
|
|
sitemap: {
|
|
|
|
hostname: meta.hostname,
|
|
|
|
},
|
|
|
|
head: [
|
|
|
|
["meta", { name: "theme-color", content: "#7bc5e4" }],
|
|
|
|
["meta", { name: "og:type", content: "website" }],
|
|
|
|
["meta", { name: "og:locale", content: "en" }],
|
|
|
|
["link", { rel: "icon", href: "/test.png" }],
|
|
|
|
// PWA
|
|
|
|
["link", { rel: "icon", href: "/test.png", type: "image/svg+xml" }],
|
|
|
|
["link", { rel: "alternate icon", href: "/test.png" }],
|
|
|
|
["link", { rel: "mask-icon", href: "/test.png", color: "#7bc5e4" }],
|
|
|
|
// prettier-ignore
|
|
|
|
["meta", { name: "keywords", content: meta.keywords.join(" ") }],
|
|
|
|
["link", { rel: "apple-touch-icon", href: "/test.png", sizes: "192x192" }],
|
|
|
|
],
|
|
|
|
transformHead: async (context) => generateMeta(context, meta.hostname),
|
|
|
|
buildEnd: async (context) => {
|
2023-12-31 11:15:48 +00:00
|
|
|
generateImages(context)
|
|
|
|
.then(() => generateFeed(context))
|
|
|
|
.finally(() => consola.success("Success!"));
|
2023-11-13 01:54:44 +00:00
|
|
|
},
|
|
|
|
vite: {
|
2024-01-24 07:53:57 +00:00
|
|
|
optimizeDeps: { exclude: ["workbox-window"] },
|
2023-11-13 01:54:44 +00:00
|
|
|
plugins: [
|
|
|
|
UnoCSS({
|
2024-01-04 08:08:55 +00:00
|
|
|
configFile: "../unocss.config.ts",
|
2023-11-13 01:54:44 +00:00
|
|
|
}),
|
2024-01-24 07:53:57 +00:00
|
|
|
{
|
|
|
|
name: "custom:adjust-order",
|
|
|
|
configResolved(c) {
|
|
|
|
movePlugin(c.plugins as any, "vitepress", "before", "unocss:transformers:pre");
|
|
|
|
},
|
|
|
|
},
|
2023-11-12 16:42:57 +00:00
|
|
|
],
|
2023-11-13 01:54:44 +00:00
|
|
|
build: {
|
|
|
|
// Shut the fuck up
|
2023-11-14 15:10:49 +00:00
|
|
|
chunkSizeWarningLimit: Number.POSITIVE_INFINITY,
|
2023-11-12 16:42:57 +00:00
|
|
|
},
|
2023-11-13 01:54:44 +00:00
|
|
|
},
|
|
|
|
markdown: {
|
2024-01-24 07:53:57 +00:00
|
|
|
emoji: { defs },
|
2023-11-13 01:54:44 +00:00
|
|
|
config(md) {
|
2024-01-24 07:53:57 +00:00
|
|
|
md.use(emojiRender);
|
2023-11-13 01:54:44 +00:00
|
|
|
md.use(toggleStarredPlugin);
|
|
|
|
md.use(base64DecodePlugin);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
themeConfig: {
|
2024-01-04 08:08:55 +00:00
|
|
|
search,
|
2023-11-13 01:54:44 +00:00
|
|
|
footer: {
|
2023-12-28 10:48:39 +00:00
|
|
|
message: `${feedback} (rev: ${commitRef})`,
|
2023-11-13 01:54:44 +00:00
|
|
|
},
|
|
|
|
outline: "deep",
|
|
|
|
logo: "/fmhy.ico",
|
|
|
|
nav: [
|
|
|
|
{ text: "Beginners Guide", link: "/beginners-guide" },
|
|
|
|
{ text: "Glossary", link: "https://rentry.org/The-Piracy-Glossary" },
|
|
|
|
{ text: "Guides", link: "https://rentry.co/fmhy-guides" },
|
|
|
|
{ text: "Backups", link: "https://www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/backups" },
|
2024-01-09 17:14:05 +00:00
|
|
|
{
|
|
|
|
text: "About",
|
|
|
|
items: [
|
|
|
|
{ text: "Posts", link: "/posts" },
|
|
|
|
{ text: "Feedback", link: "/feedback" },
|
|
|
|
],
|
|
|
|
},
|
2023-11-13 01:54:44 +00:00
|
|
|
],
|
2024-01-04 08:08:55 +00:00
|
|
|
sidebar,
|
|
|
|
socialLinks,
|
2023-11-13 01:54:44 +00:00
|
|
|
},
|
|
|
|
});
|