diff --git a/public/image/Astro-Icon.png b/public/image/Astro-Icon-Dark.png similarity index 100% rename from public/image/Astro-Icon.png rename to public/image/Astro-Icon-Dark.png diff --git a/public/image/Astro-Icon-Dark.svg b/public/image/Astro-Icon-Dark.svg new file mode 100644 index 0000000..1d446a9 --- /dev/null +++ b/public/image/Astro-Icon-Dark.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/config.ts b/src/config.ts index d87ca15..c3b2f52 100644 --- a/src/config.ts +++ b/src/config.ts @@ -14,8 +14,8 @@ export const themeConfig: ThemeConfig = { // site url url: 'https://retypeset.radishzz.cc', // favicon url - // support only ico or png for best compatibility with Open Graph and RSS avatar - favicon: '/image/Astro-Icon.png', // https://example.com/logo.png + // support only SVG, PNG and ICO + favicon: '/image/Astro-Icon-Dark.svg', // https://example.com/favicon.svg }, // SITE INFORMATION >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> END @@ -121,10 +121,8 @@ export const themeConfig: ThemeConfig = { userID: '', }, // Open Graph - openGraph: { - // image url (1200x630) - url: '', // https://placehold.co/1200x630 - }, + // Screenshot of home page for Open Graph: ./public/image/Screenshot.png + // Logo on the Open Graph: ./public/image/Astro-Icon-Dark.png }, // SEO SETTINGS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> END diff --git a/src/layouts/Head.astro b/src/layouts/Head.astro index eda065a..a6837c3 100644 --- a/src/layouts/Head.astro +++ b/src/layouts/Head.astro @@ -13,7 +13,7 @@ const { postTitle, postDescription, postSlug } = Astro.props const { title, subtitle, description, author, url, favicon } = themeConfig.site const { mode, light: { background: lightMode }, dark: { background: darkMode } } = themeConfig.color const { locale, moreLocale } = themeConfig.global -const { verification = {}, twitterID = '', googleAnalyticsID = '', umamiAnalyticsID = '', openGraph: ogUrl } = themeConfig.seo ?? {} +const { verification = {}, twitterID = '', googleAnalyticsID = '', umamiAnalyticsID = '' } = themeConfig.seo ?? {} const { google = '', bing = '', yandex = '', baidu = '' } = verification const { commentURL = '', imageHostURL = '', customGoogleAnalyticsJS = '', customUmamiAnalyticsJS = '' } = themeConfig.preload @@ -21,13 +21,13 @@ const initMetaTheme = mode === 'dark' ? darkMode : lightMode const pageTitle = postTitle ? `${postTitle} | ${title}` : `${title} - ${subtitle}` const pageDescription = postDescription || description // TODO: Change openGraph image fallback url -const openGraph = typeof ogUrl === 'string' ? ogUrl : 'https://placehold.co/1200x630' -const pageImage = postSlug ? `${url}/og/${postSlug}.png` : openGraph +const pageImage = postSlug ? `${url}/og/${postSlug}.png` : 'https://placehold.co/1200x630' ---
+{favicon.toLowerCase().endsWith('.svg') && } {favicon.toLowerCase().endsWith('.png') && } {favicon.toLowerCase().endsWith('.ico') && }