Prevent random description in Google Search results for "odysee" (#7206)

## Issue
7166 improve search metadata

Depending on the search term and timing, Google extracts data from the sidebar or page content to use as the search-result description.

## Change
Defined `description` (on top of the existing `og:description` and `twitter:description`.

While I couldn't find a definitive doc saying that this is the solution, this is present in all other sites (and matches their description in a Google Search results).
This commit is contained in:
infinite-persistence 2021-10-01 20:08:39 +08:00 committed by GitHub
parent c71b90cecf
commit dac8d711d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -78,6 +78,7 @@ function buildOgMetadata(overrideOptions = {}) {
const cleanDescription = removeMd(description || SITE_DESCRIPTION); const cleanDescription = removeMd(description || SITE_DESCRIPTION);
const head = const head =
`<title>${SITE_TITLE}</title>\n` + `<title>${SITE_TITLE}</title>\n` +
`<meta property="description" content="${cleanDescription}" />\n` +
`<meta property="og:url" content="${URL}" />\n` + `<meta property="og:url" content="${URL}" />\n` +
`<meta property="og:title" content="${title || OG_HOMEPAGE_TITLE || SITE_TITLE}" />\n` + `<meta property="og:title" content="${title || OG_HOMEPAGE_TITLE || SITE_TITLE}" />\n` +
`<meta property="og:site_name" content="${SITE_NAME || SITE_TITLE}"/>\n` + `<meta property="og:site_name" content="${SITE_NAME || SITE_TITLE}"/>\n` +