Title: feat: add site search component for published sites · Issue #306 · ycode/ycode · GitHub
Open Graph Title: feat: add site search component for published sites · Issue #306 · ycode/ycode
X Title: feat: add site search component for published sites · Issue #306 · ycode/ycode
Description: Summary Add a global Site Search feature so visitors can search across a published Ycode site (pages and CMS content) — similar to what some other website builders offer. Today Ycode has no site-wide search; only editor/CMS filtering and...
Open Graph Description: Summary Add a global Site Search feature so visitors can search across a published Ycode site (pages and CMS content) — similar to what some other website builders offer. Today Ycode has no site-wi...
X Description: Summary Add a global Site Search feature so visitors can search across a published Ycode site (pages and CMS content) — similar to what some other website builders offer. Today Ycode has no site-wi...
Opengraph URL: https://github.com/ycode/ycode/issues/306
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"feat: add site search component for published sites","articleBody":"## Summary\n\nAdd a global **Site Search** feature so visitors can search across a published Ycode site (pages and CMS content) — similar to what some other website builders offer. Today Ycode has no site-wide search; only editor/CMS filtering and a per-collection filter element exist.\n\n## Background — how some other website builders do it\n\nSome other website builders ship a drag-in **Search** component (Insert panel) that indexes the site at publish/optimization time and runs a **client-side fuzzy search** (Fuse.js-style) on the published site, so results are instant with no server round-trip.\n\n- Indexes body copy, headings, page titles, and page descriptions\n- Scope control (whole site, specific paths, or a single CMS collection)\n- Layout presets: Quick Menu (command palette), Sidebar, Fixed Top\n\n## Scope (v1)\n\nGlobal site search across **all published pages + CMS content**. (Per-collection search can build on the same foundation later.)\n\n## Indexable content sources\n\n- `pages` → `name`, `settings.seo.title`, `settings.seo.description`, `slug`\n- `page_layers.layers` → walk `variables.text` (flatten Tiptap), `variables.image.alt`, component overrides\n- `collection_item_values.value` → text / rich_text fields for dynamic pages and collection layers\n- `translations` → localized variants of the above\n\n## Proposed implementation surface\n\nClosest existing analog: the `filter` element + `FilterableCollection`.\n\n- New `search` element template (`lib/templates/`) + entry in `ElementLibrary.tsx`\n- Build-time content extraction in the publish pipeline (`app/(builder)/ycode/api/publish/route.ts`), reusing `extractLayerContentMap`, `tiptap-utils`, `text-format-utils`\n- Runtime search behavior in `LayerRendererPublic.tsx` (mirror in `LayerRenderer.tsx`), loaded as a dynamic import like other behaviors\n- Scope control + layout preset as element settings\n\n## Open design question\n\n**Indexing/query approach is undecided** and needs a design decision:\n\n- **Build-time JSON index + client-side fuzzy search (Fuse.js):** works on BOTH the live ISR site and the static HTML export (`./out`).\n- **Server-side search API + Postgres full-text search:** richer/scalable, but live-site only — would NOT work for static export.\n\nRecommendation: lean toward the client-side index for static-export parity, but this should be confirmed before implementation. Note static export has no React hydration, so it needs a dedicated boot script in `lib/apps/static-export/document.ts`.\n\n## Out of scope (v1)\n\n- Per-collection-only search UI (future, builds on the same index)\n- Search analytics / \"no results\" tracking","author":{"url":"https://github.com/ysamcode","@type":"Person","name":"ysamcode"},"datePublished":"2026-06-01T07:35:35Z","url":"https://github.com/ycode/ycode/issues/306"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f77f3b16-ada1-b3f4-eaf3-df4dda165598 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C1EE:2D8BD1:27F8CB:351C66:6AFE29F2 |
| html-safe-nonce | 705f04c8bf97f068f66e6eaa88e98fce57ce0ec9c61120291c82f7872d110660 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMUVFOjJEOEJEMToyN0Y4Q0I6MzUxQzY2OjZBRkUyOUYyIiwidmlzaXRvcl9pZCI6IjY3NzUzMjkxMzA0ODYzMTE0MTAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 759c52090018a4ca30c8ebe8604ccd0e791093a41d2004429d79743c7790b3c5 |
| hovercard-subject-tag | issue:4561222392 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/ycode/ycode/306/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fd03853501228efefa3aeb64c2b72704af916af8b4a7c78a82812f9a2c9047e0/ycode/ycode/issues/306 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fd03853501228efefa3aeb64c2b72704af916af8b4a7c78a82812f9a2c9047e0/ycode/ycode/issues/306 |
| og:image:alt | Summary Add a global Site Search feature so visitors can search across a published Ycode site (pages and CMS content) — similar to what some other website builders offer. Today Ycode has no site-wi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ysamcode |
| hostname | github.com |
| expected-hostname | github.com |
| None | e973f9ec3625f3faad8cac5c2d11a214b7ffe45f3cc563b828459b290ecaeed3 |
| turbo-cache-control | no-preview |
| go-import | github.com/ycode/ycode git https://github.com/ycode/ycode.git |
| octolytics-dimension-user_id | 65892203 |
| octolytics-dimension-user_login | ycode |
| octolytics-dimension-repository_id | 1165452593 |
| octolytics-dimension-repository_nwo | ycode/ycode |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1165452593 |
| octolytics-dimension-repository_network_root_nwo | ycode/ycode |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 1f92c367595b9190e0be293896078033886b1913 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width