mirror of
https://github.com/reonokiy/blog.nokiy.net.git
synced 2025-06-15 19:22:52 +02:00
chore: delete Open Graph configuration and change favicon format
This commit is contained in:
parent
a556a622ab
commit
db1bffb4c2
6 changed files with 9 additions and 19 deletions
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
1
public/image/Astro-Icon-Dark.svg
Normal file
1
public/image/Astro-Icon-Dark.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="85" height="107" fill="none"><path fill="#17191E" d="M27.59 91.137c-4.834-4.42-6.246-13.704-4.232-20.43 3.492 4.241 8.33 5.584 13.342 6.343 7.737 1.17 15.336.732 22.523-2.804.822-.405 1.582-.943 2.48-1.489.675 1.957.85 3.932.615 5.943-.573 4.896-3.01 8.678-6.885 11.545-1.55 1.147-3.19 2.172-4.79 3.253-4.917 3.323-6.247 7.22-4.4 12.888.044.139.084.277.183.614-2.51-1.124-4.344-2.76-5.742-4.911-1.475-2.27-2.177-4.78-2.214-7.498-.019-1.322-.019-2.656-.197-3.96-.434-3.178-1.926-4.601-4.737-4.683-2.884-.084-5.166 1.699-5.771 4.507-.046.216-.113.429-.18.68zM0 69.587s14.314-6.973 28.668-6.973L39.49 29.12c.405-1.62 1.588-2.72 2.924-2.72s2.518 1.1 2.924 2.72L56.16 62.614c17 0 28.668 6.973 28.668 6.973S60.514 3.352 60.467 3.219C59.769 1.261 58.591 0 57.003 0H27.827c-1.588 0-2.718 1.261-3.464 3.22C24.311 3.35 0 69.586 0 69.586"/></svg>
|
After Width: | Height: | Size: 882 B |
|
@ -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
|
||||
|
||||
|
|
|
@ -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'
|
||||
---
|
||||
<head>
|
||||
<!-- Basic info -->
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
|
||||
{favicon.toLowerCase().endsWith('.svg') && <link rel="icon" type="image/svg+xml" href={favicon} />}
|
||||
{favicon.toLowerCase().endsWith('.png') && <link rel="icon" type="image/png" href={favicon} />}
|
||||
{favicon.toLowerCase().endsWith('.ico') && <link rel="icon" type="image/x-icon" href={favicon} />}
|
||||
<title>{pageTitle}</title>
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import { themeConfig } from '@/config'
|
||||
import { generateDescription } from '@/utils/description'
|
||||
import { OGImageRoute } from 'astro-og-canvas'
|
||||
import { getCollection } from 'astro:content'
|
||||
|
@ -6,11 +5,6 @@ import { getCollection } from 'astro:content'
|
|||
// eslint-disable-next-line antfu/no-top-level-await
|
||||
const blogEntries = await getCollection('posts')
|
||||
|
||||
// 确定favicon路径是完整URL还是相对路径
|
||||
const logoPath = themeConfig.site.favicon.startsWith('http')
|
||||
? themeConfig.site.favicon
|
||||
: `./public${themeConfig.site.favicon}`
|
||||
|
||||
// Convert to page data objects
|
||||
const pages = Object.fromEntries(
|
||||
blogEntries.map(post => [
|
||||
|
@ -30,7 +24,7 @@ export const { getStaticPaths, GET } = OGImageRoute({
|
|||
title: page.title,
|
||||
description: page.description,
|
||||
logo: {
|
||||
path: logoPath,
|
||||
path: './public/image/Astro-Icon-Dark.png',
|
||||
size: [80],
|
||||
},
|
||||
font: {
|
||||
|
|
3
src/types/index.d.ts
vendored
3
src/types/index.d.ts
vendored
|
@ -60,9 +60,6 @@ export interface ThemeConfig {
|
|||
feedID?: string
|
||||
userID?: string
|
||||
}
|
||||
openGraph?: {
|
||||
url?: string
|
||||
}
|
||||
}
|
||||
|
||||
footer: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue