diff --git a/.github/add-headers.py b/.github/add-headers.py index 09c433031..d63d8d657 100644 --- a/.github/add-headers.py +++ b/.github/add-headers.py @@ -19,7 +19,7 @@ headersData = { "TOOLSGuide.md": ["Tools", "General Tools, Internet Tools, System Tools"], "TorrentPiracyGuide.md": ["Torrenting", "Torrent Clients, Torrent Sites, Trackers"], "VideoPiracyGuide.md": ["Movies / TV / Anime", "Stream Videos, Download Videos, Torrent Videos"], - "base64.md": ["", ""], + "base64.md": ["base64", "Base64 storage"], "img-tools.md": ["Image Tools", ""], "UnsafeSites.md": ["Unsafe Sites", ""] } diff --git a/.vitepress/config.mts b/.vitepress/config.mts index 079122330..2265c0b48 100644 --- a/.vitepress/config.mts +++ b/.vitepress/config.mts @@ -6,6 +6,7 @@ import { commitRef, meta } from "./constants"; import { pwa } from "./pwa"; import { generateMeta } from "./hooks/meta"; import { fileURLToPath } from "url"; +import { copyableCodePlugin } from "./markdown"; export default defineConfig({ title: "FMHY", @@ -57,14 +58,19 @@ export default defineConfig({ }, resolve: { alias: [ - { - find: /^.*VPSwitchAppearance\.vue$/, - replacement: fileURLToPath( - new URL("./theme/components/ThemeSwitch.vue", import.meta.url), - ), - }, - ] - } + { + find: /^.*VPSwitchAppearance\.vue$/, + replacement: fileURLToPath( + new URL("./theme/components/ThemeSwitch.vue", import.meta.url), + ), + }, + ], + }, + }, + markdown: { + config(md) { + md.use(copyableCodePlugin); + }, }, themeConfig: { search: { diff --git a/.vitepress/markdown.ts b/.vitepress/markdown.ts new file mode 100644 index 000000000..11c9f4181 --- /dev/null +++ b/.vitepress/markdown.ts @@ -0,0 +1,26 @@ +import { type MarkdownRenderer } from "vitepress"; + +// FIXME: tasky: possibly write less horror jank? +export function copyableCodePlugin(md: MarkdownRenderer) { + const decode = (str: string): string => Buffer.from(str, "base64").toString("binary"); + // Save the original rule for backticks + const defaultRender = + md.renderer.rules.code_inline || + function(tokens, idx, options, env, self) { + return self.renderToken(tokens, idx, options); + }; + + md.renderer.rules.code_inline = function(tokens, idx, options, env, self) { + // @ts-expect-error shut the fuck up already I HATE THIS + if (!env.frontmatter.title || (env.frontmatter.title && !env.frontmatter.title === "base64")) { + return defaultRender(tokens, idx, options, env, self); + } + const token = tokens[idx]; + const content = token.content; + const buttonHTML = ``; + + return buttonHTML; + }; +} diff --git a/.vitepress/theme/Layout.vue b/.vitepress/theme/Layout.vue index 0520f4052..2de3a90d1 100644 --- a/.vitepress/theme/Layout.vue +++ b/.vitepress/theme/Layout.vue @@ -1,6 +1,7 @@ @@ -10,9 +11,9 @@ const { Layout } = DefaultTheme; - diff --git a/.vitepress/theme/components/Announcement.vue b/.vitepress/theme/components/Announcement.vue new file mode 100644 index 000000000..bbea99494 --- /dev/null +++ b/.vitepress/theme/components/Announcement.vue @@ -0,0 +1,15 @@ + + + diff --git a/.vitepress/theme/style.css b/.vitepress/theme/style.css index 9d9fc850a..37df70a9b 100644 --- a/.vitepress/theme/style.css +++ b/.vitepress/theme/style.css @@ -93,6 +93,20 @@ background-color: var(--vp-button-brand-bg); } +.VPFooter a { + text-decoration-line: underline; + text-decoration-style: dashed; + text-underline-offset: 5px; + transition: 0.3s; +} + +.VPFooter a:hover { + color: var(--vp-c-text-1); + text-decoration-line: underline; + text-decoration-style: dashed; + text-underline-offset: 5px; +} + /* Custom scrollbar */ .VPSidebar::-webkit-scrollbar { block-size: 4px; @@ -123,3 +137,9 @@ --vp-home-hero-image-filter: blur(68px); } } + +.base64 { + min-width: 100%; + width: 0px; + white-space: pre-wrap; +} diff --git a/index.md b/index.md index 8d2cac78d..5df2eccc0 100644 --- a/index.md +++ b/index.md @@ -6,6 +6,9 @@ hero: name: "FMHY" text: "freemediaheckyeah" tagline: The Largest Collection Of Free Stuff On The Internet! + prelink: + title: 🎉 New website! + link: https://tenor.com/view/mauzimice-mauzymice-mauzy-mice-boykisser-cute-gif-16690839224429433467 image: src: /test.png alt: FMHY Icon diff --git a/package.json b/package.json index 2fedd8caf..72496ebbf 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "nitropack": "latest", "pathe": "^1.1.1", "unocss": "^0.57.1", - "vitepress": "1.0.0-rc.24", + "vitepress": "1.0.0-rc.25", "vue": "^3.3.7", "workbox-window": "^7.0.0" }, @@ -29,5 +29,10 @@ "@types/node": "^20.8.9", "@vite-pwa/vitepress": "^0.2.3", "prettier": "^3.0.3" + }, + "pnpm": { + "patchedDependencies": { + "vitepress@1.0.0-rc.25": "patches/vitepress@1.0.0-rc.25.patch" + } } } diff --git a/patches/vitepress@1.0.0-rc.25.patch b/patches/vitepress@1.0.0-rc.25.patch new file mode 100644 index 000000000..fe81a0694 --- /dev/null +++ b/patches/vitepress@1.0.0-rc.25.patch @@ -0,0 +1,60 @@ +diff --git a/dist/client/theme-default/Layout.vue b/dist/client/theme-default/Layout.vue +index 0ecca7ecd6f7e5ab4d576ecaf0cbc8578291a94f..32c9d80e564c42b817950ee2a1c69d62e6b304a3 100644 +--- a/dist/client/theme-default/Layout.vue ++++ b/dist/client/theme-default/Layout.vue +@@ -56,6 +56,7 @@ provide('hero-image-slot-exists', heroImageSlotExists) + + + ++ + + + +diff --git a/dist/client/theme-default/components/VPContent.vue b/dist/client/theme-default/components/VPContent.vue +index a1479dc693a8261b30b88663ba1de523cceaf877..1f49bab3aed371b5e8cf12e11870c503da2a9872 100644 +--- a/dist/client/theme-default/components/VPContent.vue ++++ b/dist/client/theme-default/components/VPContent.vue +@@ -28,6 +28,7 @@ const { hasSidebar } = useSidebar() + + + ++ + + + +diff --git a/dist/client/theme-default/components/VPHero.vue b/dist/client/theme-default/components/VPHero.vue +index 659c3dbfd36e9fcaf08b659c84c2eb378e8b49f8..2650a2b97e6d0c96f6bf56b478ece2f0c5663101 100644 +--- a/dist/client/theme-default/components/VPHero.vue ++++ b/dist/client/theme-default/components/VPHero.vue +@@ -25,6 +25,7 @@ const heroImageSlotExists = inject('hero-image-slot-exists') as Ref +
+
+
++ + +

+ +diff --git a/dist/client/theme-default/components/VPHome.vue b/dist/client/theme-default/components/VPHome.vue +index a4cda402bf7fde02c1e58b85c5d47daec458220e..d87e6fc69bd6d4b40f12b2fee90d385549583820 100644 +--- a/dist/client/theme-default/components/VPHome.vue ++++ b/dist/client/theme-default/components/VPHome.vue +@@ -7,6 +7,7 @@ import VPHomeFeatures from './VPHomeFeatures.vue' +
+ + ++ + + + +diff --git a/dist/client/theme-default/components/VPHomeHero.vue b/dist/client/theme-default/components/VPHomeHero.vue +index 5d482944ff62330939c963f43d71c788e88afa4e..a486fe63bfb4f7e41bcbf3e070ef57e8806cf9a9 100644 +--- a/dist/client/theme-default/components/VPHomeHero.vue ++++ b/dist/client/theme-default/components/VPHomeHero.vue +@@ -15,6 +15,7 @@ const { frontmatter: fm } = useData() + :image="fm.hero.image" + :actions="fm.hero.actions" + > ++ + + + diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8ab1d12ce..f68172eb5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,6 +4,11 @@ settings: autoInstallPeers: true excludeLinksFromLockfile: false +patchedDependencies: + vitepress@1.0.0-rc.25: + hash: 3rmcuf2hcpfiqvpp6fmjf4ydmq + path: patches/vitepress@1.0.0-rc.25.patch + dependencies: fast-glob: specifier: ^3.3.1 @@ -21,8 +26,8 @@ dependencies: specifier: ^0.57.1 version: 0.57.1(postcss@8.4.31)(rollup@2.79.1)(vite@4.5.0) vitepress: - specifier: 1.0.0-rc.24 - version: 1.0.0-rc.24(@algolia/client-search@4.20.0)(@types/node@20.8.9)(postcss@8.4.31)(search-insights@2.9.0) + specifier: 1.0.0-rc.25 + version: 1.0.0-rc.25(patch_hash=3rmcuf2hcpfiqvpp6fmjf4ydmq)(@algolia/client-search@4.20.0)(@types/node@20.8.9)(postcss@8.4.31)(search-insights@2.9.0) vue: specifier: ^3.3.7 version: 3.3.7 @@ -5769,8 +5774,8 @@ packages: optionalDependencies: fsevents: 2.3.3 - /vitepress@1.0.0-rc.24(@algolia/client-search@4.20.0)(@types/node@20.8.9)(postcss@8.4.31)(search-insights@2.9.0): - resolution: {integrity: sha512-RpnL8cnOGwiRlBbrYQUm9sYkJbtyOt/wYXk2diTcokY4yvks/5lq9LuSt+MURWB6ZqwpSNHvTmxgaSfLoG0/OA==} + /vitepress@1.0.0-rc.25(patch_hash=3rmcuf2hcpfiqvpp6fmjf4ydmq)(@algolia/client-search@4.20.0)(@types/node@20.8.9)(postcss@8.4.31)(search-insights@2.9.0): + resolution: {integrity: sha512-1dqWiHNThNrVZ08ixmfEDBEH+764KOgnev9oXga/x6cN++Vb9pnuu8p3K6DQP+KZrYcG+WiX7jxal0iSNpAWuQ==} hasBin: true peerDependencies: markdown-it-mathjax3: ^4.3.2 @@ -5822,6 +5827,7 @@ packages: - typescript - universal-cookie dev: false + patched: true /vscode-oniguruma@1.7.0: resolution: {integrity: sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==}