From 590d5738991bd5b7342c1c4d746e19b71cd46a09 Mon Sep 17 00:00:00 2001 From: Neha Gupta Date: Sat, 11 Jul 2026 20:12:43 +0530 Subject: [PATCH] feat(seo): default docs Article author + datePublished for E-E-A-T/freshness Live-site audit found docs Article schema dropping `author` and `datePublished` on pages whose front matter omits them (e.g. /docs/server/install/, /docs/running-keploy/api-test-generator/), weakening E-E-A-T and freshness signals for AI answer engines. - author: default to the Keploy Organization when no front-matter author, so Article schema always carries an author instead of omitting it. - datePublished: fall back to the doc's last-modified time when front matter omits `date`, so every doc carries a publication/freshness signal. Both are additive fallbacks in the swizzled DocItem; pages that already set front-matter author/date are unaffected. Not touched by the open seo/audit-fixes PR. Co-Authored-By: Claude Opus 4.8 (1M context) Signed-off-by: Neha Gupta --- src/theme/DocItem/index.js | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/src/theme/DocItem/index.js b/src/theme/DocItem/index.js index 9e040ed8d..72cc5de8e 100644 --- a/src/theme/DocItem/index.js +++ b/src/theme/DocItem/index.js @@ -159,8 +159,9 @@ export default function DocItem(props) { // Versioned root pattern: /docs// or /docs/ where // starts with a digit. Covers current and archived // versions listed in docusaurus.config.js onlyIncludeVersions. - const isVersionedDocsRoot = - /^\/docs\/\d[\w.-]*(?:\/index)?\/?$/.test(permalink); + const isVersionedDocsRoot = /^\/docs\/\d[\w.-]*(?:\/index)?\/?$/.test( + permalink + ); const isDocsRoot = permalink === "/docs/" || permalink === "/docs" || @@ -179,9 +180,24 @@ export default function DocItem(props) { headline: title, description, ...(modifiedTime ? {dateModified: modifiedTime} : {}), - ...(publishedTime ? {datePublished: publishedTime} : {}), + // datePublished falls back to the last-modified time so every doc + // carries a freshness signal even when front matter omits `date`. + ...(publishedTime || modifiedTime + ? {datePublished: publishedTime || modifiedTime} + : {}), ...(keywords ? {keywords} : {}), - ...(authorList.length ? {author: authorList} : {}), + // Default author to the Keploy organization when a doc has no + // front-matter author, so Article schema always carries an author + // (E-E-A-T) instead of dropping the field entirely. + ...(authorList.length + ? {author: authorList} + : { + author: { + "@type": "Organization", + name: "Keploy", + url: "https://keploy.io", + }, + }), ...(combinedContributors.length ? {contributor: combinedContributors} : {}), @@ -327,10 +343,7 @@ export default function DocItem(props) { - +