merge with upsteam 6eed620c37

This commit is contained in:
sevichecc 2022-12-15 23:04:28 +08:00
parent fac88146a3
commit 33938da75c
Signed by untrusted user who does not match committer: SevicheCC
GPG key ID: C577000000000000
6 changed files with 363 additions and 315 deletions

View file

@ -32,11 +32,11 @@
"@iconify-json/mdi": "^1.1.37",
"@iconify-json/simple-icons": "1.1.39",
"@iconify-json/uil": "^1.1.3",
"@sveltejs/adapter-auto": "1.0.0-next.90",
"@sveltejs/adapter-netlify": "1.0.0-next.87",
"@sveltejs/adapter-node": "1.0.0-next.104",
"@sveltejs/adapter-static": "1.0.0-next.49",
"@sveltejs/kit": "1.0.0-next.587",
"@sveltejs/adapter-auto": "1.0.0",
"@sveltejs/adapter-netlify": "1.0.0",
"@sveltejs/adapter-node": "1.0.0",
"@sveltejs/adapter-static": "1.0.0",
"@sveltejs/kit": "1.0.0",
"@tailwindcss/typography": "^0.5.8",
"@types/node": "^18.11.15",
"@types/unist": "^2.0.6",
@ -73,6 +73,7 @@
"svelte-bricks": "^0.1.7",
"svelte-check": "^2.10.2",
"svelte-preprocess": "^5.0.0",
"svelte-preprocess-import-assets": "^0.2.5",
"svelte-typeahead": "^4.4.1",
"tailwindcss": "^3.2.4",
"tslib": "^2.4.1",
@ -80,10 +81,11 @@
"unist-util-visit": "^4.1.1",
"unocss": "^0.47.6",
"vite": "^4.0.1",
"vite-imagetools": "^4.0.11",
"vite-plugin-pwa": "^0.14.0",
"workbox-window": "^6.5.4"
},
"dependencies": {
"netlify-cli": "^12.2.10"
"netlify-cli": "^12.3.0"
}
}

File diff suppressed because it is too large Load diff

View file

@ -4,18 +4,17 @@ import { feed } from '$lib/config/general'
import { favicon } from '$lib/config/icon'
import { genPosts, genTags } from '$lib/utils/posts'
const render = (
posts = genPosts({ postHtml: true, postLimit: feed.limit, filterUnlisted: true })
): string => `<?xml version='1.0' encoding='utf-8'?>
const render = (posts = genPosts({ postHtml: true, postLimit: feed.limit, filterUnlisted: true })): string =>
`<?xml version='1.0' encoding='utf-8'?>
<feed xmlns="http://www.w3.org/2005/Atom">
<id>${site.protocol + site.domain}/</id>
<title><![CDATA[${site.title}]]></title>${site.subtitle ? `\n <subtitle><![CDATA[${site.subtitle}]]></subtitle>` : ''}${
favicon ? `\n <icon>${favicon.src}</icon>` : ''
}
}
<link href="${site.protocol + site.domain}" />
<link href="${site.protocol + site.domain}/atom.xml" rel="self" type="application/atom+xml" />${
feed.hubs?.map(hub => `\n <link href="${hub}" rel="hub"/>`).join('') ?? ''
}
}
<updated>${new Date().toJSON()}</updated>
<author>
<name><![CDATA[${site.author.name}]]></name>
@ -39,7 +38,7 @@ const render = (
</entry>`
)
.join('')}
</feed>`
</feed>`.trim()
export const prerender = true
export const GET: RequestHandler = async () =>

View file

@ -2,8 +2,15 @@ import type { RequestHandler } from './$types'
import { site } from '$lib/config/site'
import { genPosts } from '$lib/utils/posts'
const render = (): string => `<?xml version='1.0' encoding='utf-8'?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
const render = (): string =>
`<?xml version='1.0' encoding='utf-8'?>
<urlset
xmlns="https://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="https://www.w3.org/1999/xhtml"
xmlns:mobile="https://www.google.com/schemas/sitemap-mobile/1.0"
xmlns:news="https://www.google.com/schemas/sitemap-news/0.9"
xmlns:image="https://www.google.com/schemas/sitemap-image/1.1"
xmlns:video="https://www.google.com/schemas/sitemap-video/1.1">
<url>
<loc>${site.protocol + site.domain}</loc>
</url>
@ -17,7 +24,7 @@ const render = (): string => `<?xml version='1.0' encoding='utf-8'?>
</url>`
)
.join('')}
</urlset>`
</urlset>`.trim()
export const prerender = true
export const GET: RequestHandler = async () =>

View file

@ -7,13 +7,14 @@ import adapterStatic from '@sveltejs/adapter-static'
// svelte preprocessor
import { mdsvex } from 'mdsvex'
import mdsvexConfig from './mdsvex.config.js'
import preprocess from 'svelte-preprocess'
import importAssets from 'svelte-preprocess-import-assets'
import { vitePreprocess } from '@sveltejs/kit/vite'
const defineConfig = (config: Config) => config
export default defineConfig({
extensions: ['.svelte', ...(mdsvexConfig.extensions as string[])],
preprocess: [mdsvex(mdsvexConfig), preprocess()],
preprocess: [mdsvex(mdsvexConfig), importAssets(), vitePreprocess()],
kit: {
adapter: Object.keys(process.env).some(key => ['VERCEL', 'CF_PAGES', 'NETLIFY'].includes(key))
? adapterAuto()

View file

@ -3,6 +3,7 @@ import { defineConfig } from 'vite'
// vite plugin
import UnoCSS from 'unocss/vite'
import { presetTagify, presetIcons, extractorSvelte } from 'unocss'
import { imagetools } from 'vite-imagetools'
import { SvelteKitPWA } from '@vite-pwa/sveltekit'
import { sveltekit } from '@sveltejs/kit/vite'
// postcss & tailwindcss
@ -39,6 +40,7 @@ export default defineConfig({
presetIcons({ scale: 1.5 })
]
}),
imagetools(),
sveltekit(),
SvelteKitPWA({
registerType: 'autoUpdate',