feat: head component with excellent SEO

This commit is contained in:
radishzzz 2025-01-16 07:48:40 +00:00
parent 5d3a3b0321
commit 7659bbd1e2
8 changed files with 221 additions and 75 deletions

View file

@ -1,6 +1,7 @@
// Plugins
import type { ThemeConfig } from './src/types'
import mdx from '@astrojs/mdx'
import partytown from '@astrojs/partytown'
import sitemap from '@astrojs/sitemap'
import { transformerCopyButton } from '@rehype-pretty/transformers'
import swup from '@swup/astro'
@ -35,6 +36,11 @@ export default defineConfig({
base: '/',
trailingSlash: 'always',
integrations: [
partytown({
config: {
forward: ['dataLayer.push'],
},
}),
UnoCSS({ injectReset: true }),
mdx(),
sitemap({

View file

@ -16,6 +16,7 @@
"dependencies": {
"@astrojs/check": "^0.9.4",
"@astrojs/mdx": "^4.0.5",
"@astrojs/partytown": "^2.1.3",
"@astrojs/rss": "^4.0.11",
"@astrojs/sitemap": "^3.2.1",
"@rehype-pretty/transformers": "^0.13.2",
@ -24,7 +25,6 @@
"astro": "^5.1.6",
"astro-compress": "^2.3.6",
"astro-robots-txt": "^1.0.0",
"astro-seo": "^0.8.4",
"markdown-it": "^14.1.0",
"overlayscrollbars": "^2.10.1",
"photoswipe": "^5.4.4",

58
pnpm-lock.yaml generated
View file

@ -14,6 +14,9 @@ importers:
'@astrojs/mdx':
specifier: ^4.0.5
version: 4.0.5(astro@5.1.6(@types/node@22.10.6)(jiti@2.4.2)(lightningcss@1.28.2)(rollup@2.79.2)(terser@5.37.0)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0))
'@astrojs/partytown':
specifier: ^2.1.3
version: 2.1.3
'@astrojs/rss':
specifier: ^4.0.11
version: 4.0.11
@ -38,9 +41,6 @@ importers:
astro-robots-txt:
specifier: ^1.0.0
version: 1.0.0
astro-seo:
specifier: ^0.8.4
version: 0.8.4(typescript@5.7.3)
markdown-it:
specifier: ^14.1.0
version: 14.1.0
@ -212,12 +212,6 @@ packages:
'@antfu/utils@0.7.10':
resolution: {integrity: sha512-+562v9k4aI80m1+VuMHehNJWLOFjBnXn3tdOitzD0il5b7smkSBal4+a3oKiQTbrwMmN/TBUMDvbdoWDehgOww==}
'@astrojs/check@0.5.10':
resolution: {integrity: sha512-vliHXM9cu/viGeKiksUM4mXfO816ohWtawTl2ADPgTsd4nUMjFiyAl7xFZhF34yy4hq4qf7jvK1F2PlR3b5I5w==}
hasBin: true
peerDependencies:
typescript: ^5.0.0
'@astrojs/check@0.9.4':
resolution: {integrity: sha512-IOheHwCtpUfvogHHsvu0AbeRZEnjJg3MopdLddkJE70mULItS/Vh37BHcI00mcOJcH1vhD3odbpvWokpxam7xA==}
hasBin: true
@ -251,6 +245,9 @@ packages:
peerDependencies:
astro: ^5.0.0
'@astrojs/partytown@2.1.3':
resolution: {integrity: sha512-pkGsV6/GUTph4oLgvrpbrGnu4+9JuG8fOCzBCI2dQKtpBYQ6XAZKHrPA3evQoB5vDbfUZGVCoWe95MnSoPbVtQ==}
'@astrojs/prism@3.2.0':
resolution: {integrity: sha512-GilTHKGCW6HMq7y3BUv9Ac7GMe/MO9gi9GW62GzKtth0SwukCu/qp2wLiGpEujhY+VVhaG9v7kv/5vFzvf4NYw==}
engines: {node: ^18.17.1 || ^20.3.0 || >=22.0.0}
@ -1521,6 +1518,11 @@ packages:
'@polka/url@1.0.0-next.28':
resolution: {integrity: sha512-8LduaNlMZGwdZ6qWrKlfa+2M4gahzFkprZiAt2TF8uS0qQgBizKXpXURqvTJ4WtmupWxaLqjRb2UCTe72mu+Aw==}
'@qwik.dev/partytown@0.11.0':
resolution: {integrity: sha512-MHime7cxj7KGrapGZ1VqLkXXq5BLNqvjNZndRJVvMkUWn92F2bsezlWW1lKDoFaKCKu2xv9LRUZL99RYOs+ccA==}
engines: {node: '>=18.0.0'}
hasBin: true
'@rehype-pretty/transformers@0.13.2':
resolution: {integrity: sha512-p2ciQSwqy5Ip8aNUa9q6rdS/hJZXrxHYYfDVOHvKOsBu3t9HDmQ65YX6r9Qbl19vi160OAxmGF7MIoCRDJrRhg==}
engines: {node: '>=18'}
@ -2197,9 +2199,6 @@ packages:
astro-robots-txt@1.0.0:
resolution: {integrity: sha512-6JQSLid4gMhoWjOm85UHLkgrw0+hHIjnJVIUqxjU2D6feKlVyYukMNYjH44ZDZBK1P8hNxd33PgWlHzCASvedA==}
astro-seo@0.8.4:
resolution: {integrity: sha512-Ou1vzQSXAxa0K8rtNtXNvSpYqOGEgMhh0immMxJeXmbVZac3UKCNWAoXWyOQDFYsZvBugCRSg0N1phBqPMVgCw==}
astro@5.1.6:
resolution: {integrity: sha512-LpTazCIW6syxFePi65gg2ptqqC2kR+PDRym3V23hEQj5yCf+T0t5v9qtp3fW0/+6G+JvP0EprCfCRTt7h/hexg==}
engines: {node: ^18.17.1 || ^20.3.0 || >=22.0.0, npm: '>=9.6.5', pnpm: '>=7.1.0'}
@ -2705,6 +2704,10 @@ packages:
dot-case@3.0.4:
resolution: {integrity: sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==}
dotenv@16.4.7:
resolution: {integrity: sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==}
engines: {node: '>=12'}
dset@3.1.4:
resolution: {integrity: sha512-2QF/g9/zTaPDc3BjNcVTGoBbXBgYfMTTceLaYcFJ/W9kggFUkhxD/hMEeuLKbugyef9SqAx8cpgwlIP/jinUTA==}
engines: {node: '>=4'}
@ -5952,18 +5955,6 @@ snapshots:
'@antfu/utils@0.7.10': {}
'@astrojs/check@0.5.10(typescript@5.7.3)':
dependencies:
'@astrojs/language-server': 2.15.4(typescript@5.7.3)
chokidar: 3.6.0
fast-glob: 3.3.3
kleur: 4.1.5
typescript: 5.7.3
yargs: 17.7.2
transitivePeerDependencies:
- prettier
- prettier-plugin-astro
'@astrojs/check@0.9.4(typescript@5.7.3)':
dependencies:
'@astrojs/language-server': 2.15.4(typescript@5.7.3)
@ -6045,6 +6036,11 @@ snapshots:
transitivePeerDependencies:
- supports-color
'@astrojs/partytown@2.1.3':
dependencies:
'@qwik.dev/partytown': 0.11.0
mrmime: 2.0.0
'@astrojs/prism@3.2.0':
dependencies:
prismjs: 1.29.0
@ -7302,6 +7298,10 @@ snapshots:
'@polka/url@1.0.0-next.28': {}
'@qwik.dev/partytown@0.11.0':
dependencies:
dotenv: 16.4.7
'@rehype-pretty/transformers@0.13.2': {}
'@rollup/plugin-alias@3.1.9(rollup@2.79.2)':
@ -8218,14 +8218,6 @@ snapshots:
valid-filename: 4.0.0
zod: 3.24.1
astro-seo@0.8.4(typescript@5.7.3):
dependencies:
'@astrojs/check': 0.5.10(typescript@5.7.3)
transitivePeerDependencies:
- prettier
- prettier-plugin-astro
- typescript
astro@5.1.6(@types/node@22.10.6)(jiti@2.4.2)(lightningcss@1.28.2)(rollup@2.79.2)(terser@5.37.0)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0):
dependencies:
'@astrojs/compiler': 2.10.3
@ -8851,6 +8843,8 @@ snapshots:
no-case: 3.0.4
tslib: 2.8.1
dotenv@16.4.7: {}
dset@3.1.4: {}
dunder-proto@1.0.1:

134
src/components/Head.astro Normal file
View file

@ -0,0 +1,134 @@
---
import themeConfig from '@/config'
interface Props {
postTitle?: string
postDescription?: string
postImage?: string
}
const { postTitle, postDescription, postImage } = Astro.props
const { title, subtitle, description, author, url, favicon } = themeConfig.site
const { language } = themeConfig.global
const { light: { backgroundStart: lightMode }, dark: { backgroundStart: darkMode } } = themeConfig.color
const { verification = {}, twitterID = '', facebookID = '', facebookLink = '', googleAnalyticsID = '', umamiAnalyticsID = '', siteScreenshot = '' } = themeConfig.seo ?? {}
const { google = '', bing = '', yandex = '', baidu = '' } = verification
const { cdn, commentURL = '', imageHostURL = '', customGoogleAnalyticsURL = '', customUmamiAnalyticsURL = '', customUmamiAnalyticsJS = '' } = themeConfig.preload
---
<!-- Basic -->
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
{favicon.toLowerCase().endsWith('.webp') && <link rel="icon" type="image/webp" href={favicon} />}
{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} />}
<title>{postTitle ? `${postTitle} - ${title}` : `${title} - ${subtitle}`}</title>
<meta name="description" content={postDescription || description} />
<meta name="author" content={author} />
<meta name="generator" content={Astro.generator} />
<meta name="theme-color" content={lightMode} media="(prefers-color-scheme: light)" />
<meta name="theme-color" content={darkMode} media="(prefers-color-scheme: dark)" />
<meta itemprop="name" content={postTitle || title} />
<meta itemprop="image" content={postImage || siteScreenshot} />
<meta itemprop="description" content={postDescription || subtitle} />
<!-- Preload -->
<link rel="preconnect" href={cdn} />
<link rel="preload" href={`${cdn}gh/radishzzz/astro-theme-retypeset@master/src/style/font.css`} as="style" />
{commentURL && <link rel="dns-prefetch" href={commentURL} />}
{imageHostURL && <link rel="dns-prefetch" href={imageHostURL} />}
{customGoogleAnalyticsURL && <link rel="dns-prefetch" href={customGoogleAnalyticsURL} />}
{customUmamiAnalyticsURL && <link rel="dns-prefetch" href={customUmamiAnalyticsURL} />}
<!-- Link -->
<link rel="author" href={url} />
<link rel="publisher" href={author} />
<link rel="canonical" href={Astro.url} />
<!-- todo language -->
<link rel="alternate" href="/en/" hreflang="en" />
<link rel="alternate" href="/rss.xml" type="application/rss+xml" title="RSS" />
<link rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/" />
<!-- Facebook Open Graph -->
<meta property="fb:app_id" content={facebookID} />
<meta property="og:url" content={Astro.url} />
<meta property="og:type" content={postTitle ? 'article' : 'website'} />
<meta property="og:title" content={postTitle || title} />
<meta property="og:image" content={postImage || siteScreenshot} />
<meta property="og:image:alt" content={postTitle || title} />
<meta property="og:description" content={postDescription || subtitle} />
<meta property="og:site_name" content={title} />
<meta property="og:locale" content={language} />
<meta property="article:author" content={facebookLink} />
<!-- Twitter Card -->
<meta name="twitter:card" content="summary" />
<meta name="twitter:url" content={Astro.url} />
<meta name="twitter:title" content={postTitle || title} />
<meta name="twitter:description" content={postDescription || subtitle} />
<meta name="twitter:image" content={postImage || siteScreenshot} />
<meta name="twitter:image:alt" content={postTitle || title} />
{twitterID && (
<>
<meta name="twitter:site" content={twitterID} />
<meta name="twitter:creator" content={twitterID} />
</>
)}
<meta name="twitter:dnt" content="on" />
<!-- Site Verification -->
{google && <meta name="google-site-verification" content={google} />}
{bing && <meta name="msvalidate.01" content={bing} />}
{yandex && <meta name="yandex-verification" content={yandex} />}
{baidu && <meta name="baidu-site-verification" content={baidu} />}
<!-- Google Analytics -->
{
googleAnalyticsID && (
<>
<script
type="text/partytown"
async
defer
crossorigin="anonymous"
src={`${customGoogleAnalyticsURL || 'https://www.googletagmanager.com'}/gtag/js?id=${googleAnalyticsID}`}
/>
<script
type="text/partytown"
async
defer
define:vars={{ googleAnalyticsID, customGoogleAnalyticsURL }}
>
window.dataLayer = window.dataLayer || []
function gtag(...args) {
dataLayer.push(args)
}
gtag('js', new Date())
if (customGoogleAnalyticsURL) {
gtag('config', googleAnalyticsID, {
transport_url: customGoogleAnalyticsURL.replace(/\/$/, ''),
})
}
else {
gtag('config', googleAnalyticsID)
}
</script>
</>
)
}
<!-- Umami Analytics -->
{
umamiAnalyticsID && (
<script
type="text/partytown"
async
defer
crossorigin="anonymous"
data-website-id={umamiAnalyticsID}
src={customUmamiAnalyticsJS || 'https://analytics.umami.is/script.js'}
data-cache="true"
/>
)
}

View file

@ -1,20 +0,0 @@
---
import themeConfig from '@/config'
const { title, subtitle, favicon } = themeConfig.site
---
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<link rel="icon" type="image/svg+xml" href={favicon} />
<meta name="generator" content={Astro.generator} />
<title>{title} - {subtitle}</title>
<link
rel="alternate"
type="application/rss+xml"
title={title}
href={`${themeConfig.site.url}/rss.xml`}
/>
</head>

View file

@ -8,7 +8,7 @@ export const themeConfig: ThemeConfig = {
description: '一个优美的博客主题',
author: 'radishzz',
url: 'https://retypeset.netlify.app',
favicon: '#',
favicon: '#', // only support webp, svg, png
},
// SITE INFORMATION >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> END
@ -26,18 +26,18 @@ export const themeConfig: ThemeConfig = {
backgroundEnd: '#000000',
},
},
// COLOR SETTINGS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> END
// COLOR SETTINGS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> END
// GLOBAL SETTINGS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> START
// GLOBAL SETTINGS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> START
global: {
language: 'zh',
font: 'sans',
rss: true,
toc: true,
language: 'zh-CN', // en-US, zh-CN
font: 'sans', // sans, serif, choose the font style for posts
rss: true, // true, false, whether to enable RSS
toc: true, // true, false, whether to enable table of contents in posts
},
// GLOBAL SETTINGS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> END
// GLOBAL SETTINGS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> END
// COMMENT SETTINGS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> START
// COMMENT SETTINGS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> START
comment: {
waline: {
serverURL: '#',
@ -49,27 +49,33 @@ export const themeConfig: ThemeConfig = {
imageUploader: true,
},
},
// COMMENT SETTINGS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> END
// COMMENT SETTINGS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> END
// SEO SETTINGS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> START
// SEO SETTINGS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> START
seo: {
twitter: 'https://twitter.com/radishzz',
meta: {
twitterID: '#', // @twitter ID
facebookID: '#', // @facebook ID
facebookLink: '#', // facebook profile link
// site verification
verification: {
google: '#',
bing: '#',
yandex: '#',
baidu: '#',
},
link: '#',
// site analytics
googleAnalyticsID: '#',
umamiAnalyticsID: '#',
// follow verification
follow: {
feedID: '#',
userID: '#',
},
siteScreenshot: '#', // Take a screenshot of website homepage to show on twitter card
},
// SEO SETTINGS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> END
// SEO SETTINGS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> END
// FOOTER SETTINGS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> START
// FOOTER SETTINGS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> START
footer: {
linkA: {
name: 'RSS',
@ -84,7 +90,19 @@ export const themeConfig: ThemeConfig = {
url: '#',
},
},
// FOOTER SETTINGS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> END
// FOOTER SETTINGS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> END
// PRELOAD SETTINGS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> START
preload: {
cdn: 'https://cdn.jsdelivr.net/', // Recommended to keep default, unless you can proxy https://cdn.jsdelivr.net/gh/radishzzz/astro-theme-retypeset@master/src/style/font.css
commentURL: '', // https://comment.example.com/
imageHostURL: '', // https://image.example.com/
// If you proxy analytics requests to the custom domain, you can fill in below
customGoogleAnalyticsURL: '', // https://whatever.example.com/
customUmamiAnalyticsURL: '', // https://whatever.example.com/
customUmamiAnalyticsJS: '', // https://whatever.example.com/whatever.js
},
// PRELOAD SETTINGS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> END
}
export default themeConfig

View file

@ -1,10 +1,12 @@
---
import Header from '@/components/Header.astro'
import Head from '@/components/Head.astro'
---
<!doctype html>
<html lang="en">
<Header />
<head>
<Head />
</head>
<body>
<slot />
</body>

18
src/types/index.d.ts vendored
View file

@ -40,19 +40,22 @@ export interface ThemeConfig {
}
seo?: {
twitter?: string
meta?: {
twitterID?: string
facebookID?: string
facebookLink?: string
verification?: {
google?: string
bing?: string
yandex?: string
baidu?: string
}
link?: string
googleAnalyticsID?: string
umamiAnalyticsID?: string
follow?: {
feedID?: string
userID?: string
}
siteScreenshot: string
}
footer: {
@ -69,6 +72,15 @@ export interface ThemeConfig {
url: string
}
}
preload: {
cdn: string
commentURL?: string
imageHostURL?: string
customGoogleAnalyticsURL?: string
customUmamiAnalyticsURL?: string
customUmamiAnalyticsJS?: string
}
}
export default ThemeConfig