mirror of
https://github.com/Sevichecc/Urara-Blog.git
synced 2025-04-30 18:59:31 +08:00
merge with upsteam 6eed620c37
This commit is contained in:
parent
fac88146a3
commit
33938da75c
6 changed files with 363 additions and 315 deletions
14
package.json
14
package.json
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
617
pnpm-lock.yaml
617
pnpm-lock.yaml
File diff suppressed because it is too large
Load diff
|
@ -4,42 +4,41 @@ 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>` : ''
|
||||
}
|
||||
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('') ?? ''
|
||||
}
|
||||
feed.hubs?.map(hub => `\n <link href="${hub}" rel="hub"/>`).join('') ?? ''
|
||||
}
|
||||
<updated>${new Date().toJSON()}</updated>
|
||||
<author>
|
||||
<name><![CDATA[${site.author.name}]]></name>
|
||||
</author>${genTags(posts)
|
||||
.map(tag => `\n <category term="${tag}" scheme="${site.protocol + site.domain}/?tags=${encodeURI(tag)}" />`)
|
||||
.join('')}${posts
|
||||
.map(
|
||||
post => `\n <entry>
|
||||
.map(
|
||||
post => `\n <entry>
|
||||
<title type="html"><![CDATA[${post.title}]]></title>
|
||||
<link href="${site.protocol + site.domain + post.path}" />
|
||||
<id>${site.protocol + site.domain + post.path}</id>
|
||||
<published>${new Date(post.published ?? post.created).toJSON()}</published>
|
||||
<updated>${new Date(post.updated ?? post.published ?? post.created).toJSON()}</updated>${
|
||||
post.summary ? `\n <summary type="html"><![CDATA[${post.summary.toString()}]]></summary>` : ''
|
||||
}
|
||||
post.summary ? `\n <summary type="html"><![CDATA[${post.summary.toString()}]]></summary>` : ''
|
||||
}
|
||||
<content type="html">
|
||||
<![CDATA[${post.html}]]>
|
||||
</content>${post.tags
|
||||
?.map(tag => `\n <category term="${tag}" scheme="${site.protocol + site.domain}/?tags=${encodeURI(tag)}" />`)
|
||||
.join('')}
|
||||
</entry>`
|
||||
)
|
||||
.join('')}
|
||||
</feed>`
|
||||
)
|
||||
.join('')}
|
||||
</feed>`.trim()
|
||||
|
||||
export const prerender = true
|
||||
export const GET: RequestHandler = async () =>
|
||||
|
|
|
@ -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 () =>
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Reference in a new issue