refactor: change the og image url for unfied the access routing.

This commit is contained in:
Yufan Sheng 2024-11-29 12:57:08 +08:00
parent a44f8ca0e5
commit 52dd541c5b
Signed by: syhily
GPG Key ID: 9D18A22A7DCD5A9B
4 changed files with 4 additions and 4 deletions

View File

@ -49,7 +49,7 @@ export default defineConfig({
],
}),
uploader({
paths: ['images', 'og', 'cats'],
paths: ['images', 'assets'],
endpoint: process.env.S3_ENDPOINT,
bucket: process.env.S3_BUCKET as string,
accessKey: process.env.S3_ACCESS_KEY as string,
@ -76,7 +76,7 @@ export default defineConfig({
optimizeDeps: { exclude: ['@napi-rs/canvas', 'opendal', 'sharp'] },
},
build: {
assets: 'cats',
assets: 'assets',
assetsPrefix: options.assetsPrefix(),
},
});

View File

@ -21,7 +21,7 @@ const { Content, headings } = await page.render();
---
<BaseLayout title={page.title} description={page.summary} footer={false}>
<PageMeta slot="og" title={page.title} description={page.summary} ogImageUrl={`/og/${page.slug}.png`} />
<PageMeta slot="og" title={page.title} description={page.summary} ogImageUrl={`/images/og/${page.slug}.png`} />
<div class="row gx-0">
<div class="col-lg-8 col-xl-8">

View File

@ -28,7 +28,7 @@ const { Content, headings } = await post.render();
description={post.summary}
publishDate={post.date.toISOString()}
requestPath={post.permalink}
ogImageUrl={`/og/${post.slug}.png`}
ogImageUrl={`/images/og/${post.slug}.png`}
ogImageAltText={`${post.title} - ${post.summary}`}
/>
<div class="px-lg-2 px-xxl-5 py-3 py-md-4 py-xxl-5">