mirror of
https://github.com/dsh-market/dsh-market.git
synced 2026-09-28 05:03:07 +08:00
seo: concede the plugin pages to the catalog site they mirror (#477)
Search Console reports 954 of this site's pages unindexed, 920 of them
"Discovered - currently not indexed": Google found the URLs in the sitemap
and declined to crawl them. The cause is not thin content but duplicate
content — every /p/<slug>/ page here renders the same README as the same
slug on awesome-dsh-plugin.com, and Google indexed that copy (5,217 pages,
48 unindexed) while parking this one.
The slugs were made identical for exactly this moment. slugOf() carries a
comment that a cross-domain canonical would be "a pure host swap with
nothing to map" — this is that swap:
- Plugin pages' canonical now points at the awesome-dsh-plugin.com page for
the same slug and locale. Verified against the live catalog site: the URL
shapes match and its pages are self-canonical, so the target is stable.
- Their hreflang alternates go away. Alternates are declared by canonical
pages; a page whose canonical says "not me" has no business declaring any.
- The sitemap drops all plugin URLs (4,904 -> 6). A sitemap is a list of
URLs we put forward as canonical, and 920 parked pages were the price of
claiming ones whose own markup disowns them. This also retires the 22
stale 404 URLs Search Console still remembers from earlier sitemaps.
What this trades away: any chance of a dshmarket.com /p/ page ranking on
its own. That chance was already near zero — the indexed copy is the
catalog's — and this site's actual search value is the home and browse
pages ("dsh market" and friends, 4,950 clicks in 28 days), which keep
their canonicals and their sitemap entries. The catalog site gets the
consolidated signals for plugin-name queries, where a detail page is the
better landing page anyway: it is the site plugin-name queries already
land on (dsh-tui: 122 clicks/28d).
The pages themselves are unchanged and stay reachable from /browse/ —
users navigate them; they are just no longer put forward for indexing.
This commit is contained in:
@@ -479,7 +479,7 @@ ${readmeHtml}
|
||||
.replaceAll('__TITLE__', () => esc(loc.P_TITLE.replace('{NAME}', p.displayName)))
|
||||
.replaceAll('__DESC__', () => esc(metaDesc))
|
||||
.replaceAll('__URL__', () => url)
|
||||
.replaceAll('__HREFLANGS__', () => hreflangs((l) => pluginPath(l, p.slug)))
|
||||
.replaceAll('__CANONICAL__', () => CATALOG + pluginPath(loc, p.slug))
|
||||
.replaceAll('__OG_IMAGE__', () => `${ORIGIN}/assets/demo-${loc.code}.png`)
|
||||
.replaceAll('__JSONLD__', () => ldSafe(jsonld))
|
||||
.replaceAll('__HOME__', () => loc.urlPath)
|
||||
@@ -514,12 +514,17 @@ const urlEntry = (pathFor, lastmod, freq) => LOCALES.map((l) => ` <url>
|
||||
${alt(pathFor)}
|
||||
</url>`).join('\n')
|
||||
|
||||
// Plugin pages are deliberately absent. They canonicalize to
|
||||
// awesome-dsh-plugin.com (see plugin-template.html), and a sitemap is a list
|
||||
// of URLs we claim as canonical — submitting 4,900 URLs whose canonical says
|
||||
// "not this site" is what kept 920 of them parked in Search Console's
|
||||
// "Discovered - currently not indexed" bucket. The pages still exist and are
|
||||
// reachable from /browse/; they just are not put forward for indexing.
|
||||
const updated = registry.updated ?? new Date().toISOString().slice(0, 10)
|
||||
fs.writeFileSync(`${OUT}/sitemap.xml`, `<?xml version="1.0" encoding="UTF-8"?>
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
|
||||
${urlEntry((l) => l.urlPath, updated, 'weekly')}
|
||||
${urlEntry((l) => l.browsePath, updated, 'daily')}
|
||||
${plugins.map((p) => urlEntry((l) => pluginPath(l, p.slug), p.added ?? updated, 'weekly')).join('\n')}
|
||||
${urlEntry((l) => l.privacyPath, updated, 'yearly')}
|
||||
</urlset>
|
||||
`)
|
||||
|
||||
@@ -9,8 +9,14 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>__TITLE__</title>
|
||||
<meta name="description" content="__DESC__">
|
||||
<link rel="canonical" href="__URL__">
|
||||
__HREFLANGS__
|
||||
<!-- The canonical points at awesome-dsh-plugin.com, not at this page. Both
|
||||
sites render the same plugin from the same README under the same slug, and
|
||||
Google noticed: 920 of these pages sat in "Discovered - currently not
|
||||
indexed" while the catalog site's copies were indexed. Conceding the
|
||||
duplicate is the fix — this site's search surface is the home and browse
|
||||
pages, not per-plugin content it mirrors. No hreflang here for the same
|
||||
reason: alternates are declared by the canonical pages, not by copies. -->
|
||||
<link rel="canonical" href="__CANONICAL__">
|
||||
<link rel="sitemap" type="application/xml" href="https://dshmarket.com/sitemap.xml">
|
||||
<link rel="icon" href="/assets/logo.svg" type="image/svg+xml">
|
||||
<meta property="og:type" content="website">
|
||||
|
||||
Reference in New Issue
Block a user