From e60e05270ccd5850b8c783fdae5112515a664fb4 Mon Sep 17 00:00:00 2001 From: taskylizard <75871323+taskylizard@users.noreply.github.com> Date: Wed, 31 Jul 2024 16:48:06 +0000 Subject: [PATCH] fix(api): return as text/plain --- .vitepress/config.mts | 4 ++-- .vitepress/hooks/opengraph.ts | 4 ++-- .vitepress/hooks/rss.ts | 2 +- .vitepress/routes/single-page.ts | 8 +++++--- .vitepress/theme/style.css | 18 +++++++++++------- 5 files changed, 21 insertions(+), 15 deletions(-) diff --git a/.vitepress/config.mts b/.vitepress/config.mts index 339bda306..7ad188383 100644 --- a/.vitepress/config.mts +++ b/.vitepress/config.mts @@ -100,8 +100,8 @@ export default defineConfig({ { text: 'Posts', link: '/posts' }, { text: 'Feedback', link: '/feedback' }, { text: 'snowbin', link: 'https://pastes.fmhy.net' }, - { text: 'SearXNG', link: 'https://searx.fmhy.net/'}, - { text: 'Whoogle', link: 'https://whoogle.fmhy.net/'} + { text: 'SearXNG', link: 'https://searx.fmhy.net/' }, + { text: 'Whoogle', link: 'https://whoogle.fmhy.net/' } ] } ], diff --git a/.vitepress/hooks/opengraph.ts b/.vitepress/hooks/opengraph.ts index 28a20ecbd..a9473dea2 100644 --- a/.vitepress/hooks/opengraph.ts +++ b/.vitepress/hooks/opengraph.ts @@ -74,11 +74,11 @@ async function generateImage({ props: { title: frontmatter.layout === 'home' - ? frontmatter.hero.name ?? frontmatter.title + ? (frontmatter.hero.name ?? frontmatter.title) : frontmatter.title, description: frontmatter.layout === 'home' - ? frontmatter.hero.tagline ?? frontmatter.description + ? (frontmatter.hero.tagline ?? frontmatter.description) : frontmatter.description } } diff --git a/.vitepress/hooks/rss.ts b/.vitepress/hooks/rss.ts index 9b8473803..5a1253306 100644 --- a/.vitepress/hooks/rss.ts +++ b/.vitepress/hooks/rss.ts @@ -40,7 +40,7 @@ export async function generateFeed(config: SiteConfig): Promise { id: `${meta.hostname}${url.replace(/\/\d+\./, '/')}`, link: `${meta.hostname}${url.replace(/\/\d+\./, '/')}`, date: frontmatter.date, - content: html?.replaceAll('​', ''), + content: html?.replaceAll('​', '') }) } diff --git a/.vitepress/routes/single-page.ts b/.vitepress/routes/single-page.ts index d29cbff24..ddc90b1bf 100644 --- a/.vitepress/routes/single-page.ts +++ b/.vitepress/routes/single-page.ts @@ -21,8 +21,8 @@ interface File { } } -export default defineEventHandler(async () => { - let body = '' +export default defineEventHandler(async (event) => { + let body = '\n' const f = fetcher({ headers: { 'User-Agent': 'taskylizard' @@ -44,7 +44,7 @@ export default defineEventHandler(async () => { return isMarkdownFile && !isExcludedFile && !isInExcludedDirectory }) - // console.info(markdownFiles.map((f) => f.name)) + console.info(markdownFiles.map((f) => f.name)) // Fetch and concatenate the contents of the markdown files const contents = await Promise.all( @@ -62,5 +62,7 @@ export default defineEventHandler(async () => { } } + // biome-ignore lint/correctness/noUndeclaredVariables: + appendResponseHeader(event, 'content-type', 'text/plain') return body }) diff --git a/.vitepress/theme/style.css b/.vitepress/theme/style.css index e80af3da0..989c2b726 100644 --- a/.vitepress/theme/style.css +++ b/.vitepress/theme/style.css @@ -120,13 +120,17 @@ */ :root { --vp-home-hero-name-color: transparent; - --vp-home-hero-name-background: -webkit-linear-gradient(120deg, - #c4b5fd 30%, - #7bc5e4); + --vp-home-hero-name-background: -webkit-linear-gradient( + 120deg, + #c4b5fd 30%, + #7bc5e4 + ); - --vp-home-hero-image-background-image: linear-gradient(-45deg, - #c4b5fd 50%, - #47caff 50%); + --vp-home-hero-image-background-image: linear-gradient( + -45deg, + #c4b5fd 50%, + #47caff 50% + ); --vp-home-hero-image-filter: blur(44px); } @@ -232,7 +236,7 @@ } } -#VPContent strong>a { +#VPContent strong > a { font-weight: bold; }