Skip to content

Commit 526b0ee

Browse files
committed
fix: generate api/index.html and improve DocFX search indexing
- Align docfx.json content section with docfx-local.json: include index.md and toc.yml so DocFX generates /api/index.html - Add CI step to inject data-pagefind-body on DocFX <main> elements so Pagefind indexes only the article content, not navigation noise
1 parent 147b0ed commit 526b0ee

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ jobs:
6868
env:
6969
GOOGLE_ANALYTICS_ID: ${{ secrets.GOOGLE_ANALYTICS_ID }}
7070

71+
- name: Annotate DocFX pages for Pagefind indexing
72+
run: |
73+
find dist/api -name "*.html" -exec sed -i 's|<main class="container-xxl">|<main class="container-xxl" data-pagefind-body>|g' {} \;
74+
7175
- name: Merge DocFX sitemap into Astro sitemap index
7276
run: |
7377
sed -i 's|</sitemapindex>| <sitemap>\n <loc>https://repl.yllibed.org/api/sitemap.xml</loc>\n </sitemap>\n</sitemapindex>|' dist/sitemap-index.xml

docfx/docfx.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,8 @@
4848
],
4949
"build": {
5050
"content": [
51-
{
52-
"files": ["api/**.yml", "api/index.md"]
53-
}
51+
{ "files": ["index.md", "toc.yml"] },
52+
{ "files": ["api/**.yml", "api/index.md", "api/toc.yml"] }
5453
],
5554
"dest": "../public/api",
5655
"globalMetadata": {

0 commit comments

Comments
 (0)