Skip to content

feat(docs): Google 'Add to preferred sources' button in the site footer - #36

Merged
SebaSOFT merged 1 commit into
mainfrom
feat/preferred-source-footer
Sep 28, 2026
Merged

SebaSOFT merged 1 commit into
mainfrom
feat/preferred-source-footer

Conversation

@SebaSOFT

Copy link
Copy Markdown
Owner

What

Botón oficial de Google Add to preferred sources en el footer de todas las páginas del sitio de docs. Implementación estándar de la doc oficial (developers.google.com/search/docs/appearance/preferred-sources):

  • publisher.js (async) en el head de VitePress — la librería oficial de Google
  • PreferredSourceFooter.vue montado en el slot layout-bottom (persiste en navegación SPA, verificado): renderiza el contenedor google-add-preferred-source-btn escaneado automáticamente + nota explicativa
  • Theme-aware: data-theme light/dark sigue el tema del sitio
  • Copy honesto: el source elegible es el dominio sebasoft.github.io — la tool de preferencias de Google acepta dominios y subdominios, no subdirectorios (nuestro site vive en /neuron-js/)

Por qué importa

Preferred Sources hace que el contenido aparezca con badge `preferred` en Top Stories, AI Overviews y AI Mode de Google para los usuarios que nos agregan — refuerzo directo de la línea de descubrimiento por agentes (SEO-6).

Verificación real (browser, build servido por HTTP)

  • publisher.js carga y escanea + inicializa el contenedor (data-initialized=true)
  • El contenedor sobrevive navegación SPA (slot layout-bottom queda montado entre rutas; 1 solo script, sin duplicados)
  • Click abre el service iframe de Google (news.google.com/swg/ui/v1/serviceiframe) — el flujo real de adición
  • Suite: 121/121 (+4 contract tests del footer), docs:build verde

Nota de branching

PR independiente de #35 (WebMCP) — ambos tocan docs/.vitepress/config.ts (head) sin conflicto real: #35 agrega los dos scripts webmcp, este agrega publisher.js. Merge en cualquier orden.

- Standard JavaScript implementation from the official Google docs:
  publisher.js in the VitePress head + the auto-scanned
  [google-add-preferred-source-btn] container.
- PreferredSourceFooter.vue mounts in the layout-bottom slot: renders
  the Google button (theme-aware: light/dark follows the site theme)
  plus an honest note — the eligible source is the domain
  sebasoft.github.io (Google's source preferences tool accepts domains
  and subdomains, not subdirectories).
- Browser E2E verified on the HTTP-served build: publisher.js scans
  and initializes the container (data-initialized=true), the container
  survives SPA route changes (layout-bottom slot stays mounted), and
  clicking opens the Google service iframe (news.google.com/swg/ui).
- tests/contracts/preferred-source-footer.test.ts: 4 contract tests
  over the footer surface.
@SebaSOFT
SebaSOFT force-pushed the feat/preferred-source-footer branch from 7146b99 to 542687d Compare September 28, 2026 13:00
@SebaSOFT
SebaSOFT merged commit b868093 into main Sep 28, 2026
2 checks passed
@SebaSOFT
SebaSOFT deleted the feat/preferred-source-footer branch September 28, 2026 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant