Fix public site deindexing by Google: SSR CV content and move preview banner to JS#163
Merged
Merged
Conversation
The multi-language rollout combined two problems into a strong "don't index" signal that caused Google to drop the public site from its index: 1. The admin "Preview Mode — This is a saved version and not publicly accessible" banner was hardcoded in public-readonly/index.html and only hidden via CSS. Crawlers read hidden text, so every public page advertised itself as not publicly accessible — a textbook soft-404 signal. 2. servePublicIndex returned an empty shell with `<h1>Loading…</h1>` and empty section containers; all CV content was hydrated client-side. Googlebot often skips the JS render pass on low-authority subdomains and treated the page as thin content. Changes: - Move preview banner DOM out of the static HTML and inject it from JS only when window.DATASET_PREVIEW is true. Add preview.banner_text and preview.back_to_admin i18n keys to all 8 locales so the banner stays translated when shown. - Server-render the profile, about, experience, certifications, education, skills and projects sections in servePublicIndex (default-dataset path, live-DB fallback path) and serveDatasetPage. The client JS still hydrates the same nodes, so behaviour is unchanged for users. - Set `<html lang>` in the live-DB fallback path (it was already correct on the default-dataset path). https://claude.ai/code/session_012QpBLqtiKoHg8mVfqXLwDj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes a critical SEO issue where the public CV site was being deindexed by Google after the multi-language rollout. Two problems combined into a strong "don't index" signal:
Preview banner in raw HTML: The admin "Preview Mode — This is a saved version and not publicly accessible" banner was hardcoded into
public-readonly/index.htmland only hidden via CSS. Search crawlers read hidden text, so every public page advertised itself as not publicly accessible — a textbook soft-404 signal that caused Google to drop the URL.Thin content on public homepage: The public homepage was a near-empty shell server-side (
<h1>Loading…</h1>with empty section containers). All CV content was hydrated client-side, but Googlebot frequently skips the second render pass on low-authority subdomains and treated the page as thin content.Solution:
window.DATASET_PREVIEWis true (admin preview context), so the banner text never appears in HTML served to public visitorsservePublicIndex()andserveDatasetPage()now render profile, about, experience, certifications, education, skills, and projects sections into the HTML before sending<html lang>attribute correctly from database settings on the live homepageType of Change
Checklist
Required for all code changes
npm testpasses)package.json,package-lock.json,version.json)CHANGELOG.mdhas been updated with a new entry under the correct versionIf adding or changing user-visible strings
t('key')in JS ordata-i18nin HTMLen.jsonand all 7 other locale files (de,fr,nl,es,it,pt,zh)escapeHtml()used for any user-provided content rendered as HTMLIf documentation-only change
Test Plan
?preview=...), not on public pages<html lang>attribute matches database language setting on live homepagehttps://claude.ai/code/session_012QpBLqtiKoHg8mVfqXLwDj