diff --git a/frontend/site/src/components/SiteNav.astro b/frontend/site/src/components/SiteNav.astro index f0c93d4..05d4b4f 100644 --- a/frontend/site/src/components/SiteNav.astro +++ b/frontend/site/src/components/SiteNav.astro @@ -3,6 +3,7 @@ const links = [ { href: '/', label: '首页' }, { href: '/archive/', label: '归档' }, { href: '/tags/', label: '标签' }, + { href: '/site-map/', label: '站点地图' }, { href: '/rss.xml', label: 'RSS' } ]; --- diff --git a/frontend/site/src/components/seo/SeoHead.astro b/frontend/site/src/components/seo/SeoHead.astro new file mode 100644 index 0000000..ae5b21f --- /dev/null +++ b/frontend/site/src/components/seo/SeoHead.astro @@ -0,0 +1,57 @@ +--- +import { site } from '../../lib/siteConfig'; +import { absoluteUrl } from '../../lib/seo'; + +type JsonLd = Record | Record[]; + +type Props = { + title?: string; + description?: string; + path?: string; + type?: 'website' | 'article'; + publishedTime?: string; + modifiedTime?: string; + tags?: string[]; + jsonLd?: JsonLd; +}; + +const { + title = site.title, + description = site.description, + path = '/', + type = 'website', + publishedTime, + modifiedTime, + tags = [], + jsonLd +} = Astro.props; + +const pageTitle = title === site.title ? site.title : `${title} | ${site.title}`; +const canonicalUrl = absoluteUrl(path); +const rssUrl = absoluteUrl('/rss.xml'); +--- + + + +{pageTitle} + + + + + + + + + + + + + +{publishedTime && } +{modifiedTime && } +{tags.map((tag) => )} +{ + jsonLd && ( +