You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pnpm redirects:sync # Update redirects.json for moved pages
58
+
pnpm redirects:check # Check redirect coverage without writing files
59
+
pnpm index:docs # Build the search index in Typesense
60
+
pnpm typecheck:scripts # Type check repository scripts
61
+
```
62
+
63
+
`pnpm install` configures `.githooks` for the repository when no custom `core.hooksPath` is set. The pre-commit hook can add missing `stableId` values to staged docs files. The pre-push hook checks redirects when docs content, redirect configuration, or content configuration changes.
64
+
65
+
## ✍️ Authoring Content
66
+
67
+
Pages live as Markdown files under `content/`. Frontmatter fields are validated by the schema in `content.config.ts`.
68
+
69
+
### Framework Guides
70
+
71
+
Framework guides live under `content/frameworks/<framework>/`. The numeric prefix on filenames (`01.`, `02.`, …) controls sidebar sort order only — it has no semantic meaning, renumber freely.
72
+
73
+
The `section` frontmatter field controls grouping on the `/frameworks/<framework>` hub page:
74
+
75
+
-`section: start-here` — appears in the "Start Here" block at the top.
76
+
-`section: guides` (or unset) — appears in the "Guides" block below.
77
+
78
+
Minimal frontmatter for a new framework guide:
79
+
80
+
```yaml
81
+
---
82
+
title: Fetch Data from Directus with Foo
83
+
description: Learn how to integrate Directus in your Foo app.
84
+
section: start-here
85
+
technologies:
86
+
- foo
87
+
navigation:
88
+
title: Data Fetching
89
+
---
90
+
```
91
+
50
92
## ☁️ Deploying the Docs
51
93
52
94
The documentation automatically deploys to Vercel when changes are merged into the main branch. Simply:
@@ -68,9 +110,45 @@ The documentation automatically deploys to Vercel when changes are merged into t
Search is powered by [Typesense](https://typesense.org). The browser palette (`UCommandPalette`-based) lives at `app/components/DocsSearchPalette.vue` and queries Typesense directly via `app/services/typesenseService.ts`. The official `typesense` npm client is used by the indexer only.
116
+
117
+
### Indexing
118
+
119
+
The indexer at `scripts/index-docs.ts` walks `/content`, chunks each Markdown page, attaches synonyms, and pushes everything to Typesense. OpenAPI indexing is deferred to a later branch. Run it locally with:
120
+
121
+
```bash
122
+
pnpm index:docs
123
+
```
124
+
125
+
CI runs the same command on every push to `main` (production index) and on every PR commit (per-branch preview index). See `.github/workflows/search-index.yml`.
126
+
127
+
### Collection naming
128
+
129
+
Indexes use a blue/green slot pattern with a stable alias:
130
+
131
+
-`main` -> alias `directus-docs`, slots `directus-docs-a` / `directus-docs-b`
132
+
- Branch `bry/foo` -> alias `directus-docs-preview-bry-foo`, slots `...-a` / `...-b`
133
+
- Local branch runs use the same branch-derived alias as CI
134
+
135
+
Each indexer run writes to whichever slot the alias is not currently pointing at, swaps the alias, then deletes the previous slot.
136
+
137
+
For one-off writes, override the index target with `TYPESENSE_INDEX_TARGET=...`.
138
+
139
+
The browser reads from `TYPESENSE_COLLECTION` when set. Otherwise it derives the same branch alias as the indexer. The app reads the alias, never the `-a` / `-b` slot name.
140
+
141
+
### Ranking
142
+
143
+
Section boosts and personalization live in `buildPersonalizedSortBy` in `app/composables/useDocsSearch.ts`. The same `sectionPriority` array drives both the Typesense `_eval` boost order and the chip-bar render order in the palette.
144
+
145
+
### Synonyms
146
+
147
+
Search synonyms live in `server/data/synonyms.ts` and are pushed to Typesense on every indexer run. Two formats: `multiway` (equivalent terms) and `oneway` (directional shorthand -> canonical, e.g. `db -> database`). Header comment in the file explains both.
148
+
149
+
### Search-friendly content
72
150
73
-
The docs make use of the Algolia Crawler to index the content. The crawler is found at the bottom left in the Algolia dashboard under `Data Sources > Crawler > directus`. To make changes on how the crawler works, go to the `Editor` tab and make your changes. By default the crawler runs once a day but you can also manually run it. In order to tweak the ranking of search results, go to the `Search > Configure > Index > Configuration > Ranking and Sorting` tab.
151
+
Write H2s and first paragraphs so they work as standalone search results.
0 commit comments