mirror of
https://github.com/reonokiy/blog.nokiy.net.git
synced 2025-06-15 19:22:52 +02:00
✨ feat: add image lightbox functionality
- Add imageConfig in astro.config.ts to optimize remote image processing in Markdown files - Update PhotoSwipe component initialization logic to ensure proper setup on page load
This commit is contained in:
parent
043b811ce4
commit
dfc30d7f85
5 changed files with 115 additions and 118 deletions
|
@ -16,6 +16,17 @@ import { remarkReadingTime } from './src/plugins/remark-reading-time'
|
|||
const url = themeConfig.site.url
|
||||
const locale = themeConfig.global.locale
|
||||
const linkPrefetch = themeConfig.preload.linkPrefetch
|
||||
const imageHostURL = themeConfig.preload.imageHostURL
|
||||
const imageConfig = imageHostURL
|
||||
? {
|
||||
// Configure domains and remotePatterns to optimize remote images in Markdown files using  syntax (adds width and height)
|
||||
// Docs: https://docs.astro.build/en/guides/images/#authorizing-remote-images
|
||||
image: {
|
||||
domains: [imageHostURL],
|
||||
remotePatterns: [{ protocol: 'https' }],
|
||||
}
|
||||
}
|
||||
: {};
|
||||
|
||||
export default defineConfig({
|
||||
site: url,
|
||||
|
@ -25,6 +36,7 @@ export default defineConfig({
|
|||
prefetchAll: true,
|
||||
defaultStrategy: linkPrefetch,
|
||||
},
|
||||
...imageConfig,
|
||||
i18n: {
|
||||
locales: Object.entries(langMap).map(([path, codes]) => ({
|
||||
path,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue