Skip to content

Commit 8c58462

Browse files
Revert "replace local search with Algolia search (#5555)" (#5658)
This reverts commit defa07c.
1 parent a38263b commit 8c58462

38 files changed

+9855
-49
lines changed

.github/workflows/update-search.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Update search index
2+
on:
3+
workflow_dispatch:
4+
5+
jobs:
6+
update-search:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- run: git submodule update --init
11+
- uses: actions/setup-node@v3
12+
with:
13+
node-version: 18
14+
- name: Dump Identity
15+
run: |
16+
mkdir -p ~/.config/dfx/identity/default
17+
echo $DFX_IDENTITY_PREVIEW | base64 -d > ~/.config/dfx/identity/default/identity.pem
18+
env:
19+
DFX_IDENTITY_PREVIEW: ${{ secrets.DFX_IDENTITY_PREVIEW }}
20+
21+
- name: Build website
22+
run: |
23+
npm install
24+
npm run build
25+
env:
26+
CONTENTFUL_ACCESS_TOKEN: ${{ secrets.CONTENTFUL_ACCESS_TOKEN }}
27+
CONTENTFUL_HOST: ${{ secrets.CONTENTFUL_HOST }}
28+
CONTENTFUL_SPACE_ID: ${{ secrets.CONTENTFUL_SPACE_ID }}
29+
AIRTABLE_KEY: ${{ secrets.AIRTABLE_SA_PORTAL_SERVICE_ACCOUNT }}
30+
YOUTUBE_API_KEY: ${{ secrets.YOUTUBE_API_KEY }}
31+
32+
- name: Remove redirect pages
33+
run: |
34+
rm -rf build/bitcoin-integration/
35+
# Other redirects to remove
36+
37+
- name: Update search index
38+
run: |
39+
cd search/src/doc_generator
40+
pip install -r requirements.txt
41+
cd ../../..
42+
python search/src/doc_generator/generate-docs.py "./build/**/*.html"
43+
cd search
44+
45+
cargo run --release --bin search-cli -- index ../docs.json stopwords.txt output.json
46+
cargo run --release --bin search-cli -- upload output.json stopwords.txt 5qden-jqaaa-aaaam-abfpa-cai ~/.config/dfx/identity/default/identity.pem

docusaurus.config.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,7 @@ const config = {
587587
organizationName: "dfinity",
588588
projectName: "portal",
589589
customFields: {
590+
searchCanisterId: "5qden-jqaaa-aaaam-abfpa-cai",
590591
marketingNav,
591592
},
592593
markdown: {
@@ -691,19 +692,6 @@ const config = {
691692
// but to do that type preset- classic had to be disabled below
692693
// /** @type {import('@docusaurus/preset-classic').ThemeConfig} */
693694
{
694-
algolia: {
695-
// The application ID provided by Algolia
696-
appId: 'B0O3KB7MGW',
697-
698-
// Public API key: it is safe to commit it
699-
apiKey: '43d8a7a6f4697a580cdf0cb021affddb',
700-
701-
indexName: 'internetcomputer',
702-
703-
contextualSearch: true,
704-
705-
insights: true,
706-
},
707695
image: "/img/share.webp",
708696
colorMode: {
709697
disableSwitch: false,

package-lock.json

Lines changed: 37 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)