Skip to content

Commit 30df73a

Browse files
committed
docs(seo): add sitemap lastmod, local search, custom 404
Three more SEO + UX wins on top of the metadata pass: - Sitemap now emits <lastmod> per URL (datetime, ISO-8601). Google uses it to prioritize recrawls — recently-edited pages get fetched faster. - Added @easyops-cn/docusaurus-search-local: a build-time client-side search index with a navbar search box. No external service required; improves dwell-time signals and lets users land on deep pages. - Custom /404 page with curated links to the intro, quick-start, API ref, recipes, and changelog (instead of Docusaurus's default generic 404). Reduces bounce rate when external links rot.
1 parent fe3181b commit 30df73a

4 files changed

Lines changed: 337 additions & 30 deletions

File tree

apps/docs/docusaurus.config.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,25 @@ const config = {
9595
},
9696
],
9797

98+
plugins: [
99+
[
100+
require.resolve('@easyops-cn/docusaurus-search-local'),
101+
/** @type {import('@easyops-cn/docusaurus-search-local').PluginOptions} */
102+
({
103+
hashed: true,
104+
indexDocs: true,
105+
indexBlog: false,
106+
indexPages: true,
107+
docsRouteBasePath: '/docs',
108+
highlightSearchTermsOnTargetPage: true,
109+
searchResultLimits: 10,
110+
searchBarShortcut: true,
111+
searchBarShortcutHint: true,
112+
explicitSearchResultPath: true,
113+
}),
114+
],
115+
],
116+
98117
presets: [
99118
[
100119
'classic',
@@ -115,6 +134,9 @@ const config = {
115134
priority: 0.7,
116135
ignorePatterns: ['/tags/**'],
117136
filename: 'sitemap.xml',
137+
// lastmod from each doc's last update (git-tracked or frontmatter).
138+
// Lets Google prioritize recrawls for recently-changed pages.
139+
lastmod: 'datetime',
118140
},
119141
}),
120142
],

apps/docs/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
},
2424
"devDependencies": {
2525
"@docusaurus/module-type-aliases": "^3.7.0",
26-
"@docusaurus/types": "^3.7.0"
26+
"@docusaurus/types": "^3.7.0",
27+
"@easyops-cn/docusaurus-search-local": "^0.55.1"
2728
},
2829
"browserslist": {
2930
"production": [

apps/docs/src/pages/404.mdx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
title: Page not found
3+
description: That page doesn't exist (or moved). Jump to the docs intro, the quick-start, or the API reference.
4+
---
5+
6+
# Page not found
7+
8+
The URL you followed doesn't match any page on this site. A few common landings:
9+
10+
- [**Introduction**](/docs) — what fhir-dsl is and how the pieces fit.
11+
- [**Quick start**](/docs/getting-started/quick-start) — install and write your first typed query.
12+
- [**API reference**](/docs/api/core) — every package's public surface.
13+
- [**Recipes**](/docs/recipes/patient-timeline) — copy-paste patterns for common tasks.
14+
- [**Changelog**](/docs/changelog) — what shipped recently.
15+
16+
Try the search box at the top — it indexes every page. Or [open an issue on GitHub](https://github.com/awbx/fhir-dsl/issues) if you think a link is broken.

0 commit comments

Comments
 (0)