Skip to content

Commit 646205d

Browse files
modifies workflow to update search.json for searching docs (#70)
* testing search index merge 1 * testing search index merge 2 * testing search index merge 2 * testing search index merge 4 * new search workflow and hotfix in _quarto.yml * fixed workflow * keep original search index * simplified final main site workflow * final main site workflow * hotfix
1 parent a3594b8 commit 646205d

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

.github/workflows/publish.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,26 @@ jobs:
2121
- name: Render Quarto site
2222
run: quarto render
2323

24+
- name: Rename original search index
25+
run: mv _site/search.json _site/search_original.json
26+
27+
- name: Install jq
28+
run: sudo apt-get install jq
29+
30+
- name: Fetch search.json from docs site
31+
run: curl -O https://raw.githubusercontent.com/TuringLang/docs/gh-pages/search.json
32+
33+
- name: Fix URLs in docs site search index
34+
run: |
35+
jq 'map(if .href then .href = "docs/" + .href else . end) |
36+
map(if .objectID then .objectID = "docs/" + .objectID else . end)' search.json > fixed_docs_search.json
37+
38+
- name: Merge search indices
39+
run: |
40+
jq -s '.[0] + .[1]' _site/search_original.json fixed_docs_search.json > _site/search.json
41+
2442
- name: Deploy to GitHub Pages
2543
uses: JamesIves/github-pages-deploy-action@v4
2644
with:
2745
branch: gh-pages
2846
folder: _site
29-
clean: false

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
This repository contains the quarto source for the `Turing.jl` website.
44

5-
To get started with the `Turing.jl` website locally, you'll need to have the following prerequisites installed:
5+
To get started with the `Turing.jl` website locally, you'll need to have the following prerequisite installed:
66

77
- [Quarto](https://quarto.org/docs/download/)
88

9-
Once you have these prerequisites installed, you can follow these steps:
9+
Once you have this prerequisite installed, you can follow these steps:
1010

1111
1. Clone this repository:
1212

0 commit comments

Comments
 (0)