mirror of
https://github.com/rustdesk/doc.rustdesk.com.git
synced 2026-10-18 22:44:10 +00:00
Open Graph locale, JSON-LD language and the blog breadcrumb follow the post's language, the FAQ heading is translated, and time elements use ISO dates. llms.txt and llms-full.txt list core capabilities next to the licensing and deployment boundaries. New tests keep FAQ answers plain text and in step with the English, catch repeated paragraphs, overlong meta descriptions and "prorated" upgrade wording, and a build verifier checks the rendered blog. IndexNow no longer reports success when a sitemap cannot be read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
88 lines
2.5 KiB
Plaintext
88 lines
2.5 KiB
Plaintext
---
|
|
import merge from 'lodash.merge';
|
|
import { AstroSeo } from '@astrolib/seo';
|
|
|
|
import type { Props as AstroSeoProps } from '@astrolib/seo';
|
|
|
|
import { SITE, METADATA, I18N } from 'astrowind:config';
|
|
import type { MetaData } from '~/types';
|
|
import { getCanonical } from '~/utils/permalinks';
|
|
|
|
import { adaptOpenGraphImages } from '~/utils/images';
|
|
import { LOCALES, type Lang } from '@/i18n';
|
|
|
|
export interface Props extends MetaData {
|
|
dontUseTitleTemplate?: boolean;
|
|
lang?: Lang;
|
|
}
|
|
|
|
const {
|
|
title,
|
|
ignoreTitleTemplate = false,
|
|
canonical = String(getCanonical(String(Astro.url.pathname))),
|
|
robots = {},
|
|
description,
|
|
keywords,
|
|
author,
|
|
openGraph = {},
|
|
twitter = {},
|
|
lang = Astro.currentLocale as Lang,
|
|
} = Astro.props;
|
|
|
|
const seoProps: AstroSeoProps = merge(
|
|
{
|
|
title: '',
|
|
titleTemplate: '%s',
|
|
canonical: canonical,
|
|
noindex: true,
|
|
nofollow: true,
|
|
description: undefined,
|
|
openGraph: {
|
|
url: canonical,
|
|
site_name: SITE?.name,
|
|
images: [],
|
|
locale: LOCALES[lang || I18N?.language]?.openGraphLocale || 'en_US',
|
|
type: 'website',
|
|
},
|
|
twitter: {
|
|
cardType: openGraph?.images?.length ? 'summary_large_image' : 'summary',
|
|
},
|
|
},
|
|
{
|
|
title: METADATA?.title?.default,
|
|
titleTemplate: METADATA?.title?.template,
|
|
noindex: typeof METADATA?.robots?.index !== 'undefined' ? !METADATA.robots.index : undefined,
|
|
nofollow: typeof METADATA?.robots?.follow !== 'undefined' ? !METADATA.robots.follow : undefined,
|
|
description: METADATA?.description,
|
|
openGraph: METADATA?.openGraph,
|
|
twitter: METADATA?.twitter,
|
|
},
|
|
{
|
|
title: title,
|
|
titleTemplate: ignoreTitleTemplate ? '%s' : undefined,
|
|
canonical: canonical,
|
|
noindex: typeof robots?.index !== 'undefined' ? !robots.index : undefined,
|
|
nofollow: typeof robots?.follow !== 'undefined' ? !robots.follow : undefined,
|
|
description: description,
|
|
openGraph: { url: canonical, ...openGraph },
|
|
twitter: twitter,
|
|
}
|
|
);
|
|
|
|
const crawlerDirectives = [
|
|
seoProps.noindex ? 'noindex' : 'index',
|
|
seoProps.nofollow ? 'nofollow' : 'follow',
|
|
'max-image-preview:large',
|
|
'max-snippet:-1',
|
|
'max-video-preview:-1',
|
|
].join(', ');
|
|
---
|
|
|
|
<AstroSeo {...{ ...seoProps, openGraph: await adaptOpenGraphImages(seoProps?.openGraph, Astro.site) }} />
|
|
|
|
<!-- Additional SEO meta tags -->
|
|
{keywords && <meta name="keywords" content={keywords} />}
|
|
{author && <meta name="author" content={author} />}
|
|
<meta name="googlebot" content={crawlerDirectives} />
|
|
<meta name="bingbot" content={crawlerDirectives} />
|