Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/index-meilisearch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: index-meilisearch

on:
push:
branches:
- master
workflow_dispatch:

jobs:
index-meilisearch:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22"
- uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/**/.cache
${{ github.workspace }}/website/node_modules
key: |
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Install dependencies
run: cd website && yarn

- name: Index to MeiliSearch
run: cd website && yarn run meilisearch:build-index
env:
MEILI_HOST: ${{ secrets.MEILI_HOST }}
MEILI_MASTER_KEY: ${{ secrets.MEILI_MASTER_KEY }}
MEILI_INDEX_NAME: ${{ secrets.MEILI_INDEX_NAME }}
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion website/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,10 @@ REACT_APP_NEAR_TOWN_HALL_CALENDAR_ID=

# Analytics
REACT_APP_PUBLIC_POSTHOG_KEY=
REACT_APP_PUBLIC_POSTHOG_HOST=
REACT_APP_PUBLIC_POSTHOG_HOST=

# MeiliSearch
MEILI_HOST=http://localhost:7700
MEILI_MASTER_KEY=masterKey123
MEILI_SEARCH_KEY=
MEILI_INDEX_NAME=near-docs
16 changes: 16 additions & 0 deletions website/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: '3.8'
services:
meilisearch:
image: getmeili/meilisearch:v1.34
container_name: near-docs-search
ports:
- "7700:7700"
environment:
- MEILI_MASTER_KEY=${MEILI_MASTER_KEY:-masterKey123}
- MEILI_ENV=development
volumes:
- meilisearch_data:/meili_data

volumes:
meilisearch_data:

28 changes: 5 additions & 23 deletions website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ const config = {
REACT_APP_GOOGLE_CALENDAR_API_KEY: process.env.REACT_APP_GOOGLE_CALENDAR_API_KEY,
REACT_APP_LUMA_NEAR_CALENDAR_ID: process.env.REACT_APP_LUMA_NEAR_CALENDAR_ID,
REACT_APP_DEVHUB_GOOGLE_CALENDAR_ID: process.env.REACT_APP_DEVHUB_GOOGLE_CALENDAR_ID,
meilisearch: {
host: process.env.MEILI_HOST || 'http://localhost:7700',
apiKey: process.env.MEILI_SEARCH_KEY || process.env.MEILI_MASTER_KEY || 'masterKey123',
indexName: process.env.MEILI_INDEX_NAME || 'near-docs',
},
},
themes: ['@saucelabs/theme-github-codeblock', '@docusaurus/theme-mermaid'],
onBrokenLinks: 'throw',
Expand Down Expand Up @@ -278,29 +283,6 @@ const config = {
src: 'img/near_logo.svg',
},
},
algolia: {
// The application ID provided by Algolia
appId: '0LUM67N2P2',
// Public API key: it is safe to commit it
apiKey: '41e2feb6ffa0d3450ca9d0a0c1826c1c',
indexName: 'docs',
askAi: {
assistantId: 'ck1jQv3AzZ5R',
indexName: 'docs.md',
apiKey: '41e2feb6ffa0d3450ca9d0a0c1826c1c',
appId: '0LUM67N2P2',
},
// Optional: see doc section below
contextualSearch: true,
// Optional: Algolia search parameters
searchParameters: {
clickAnalytics: true,
analytics: true,
},
//... other Algolia params
placeholder: 'Search the Docs...',
insights: true,
},
},
};

Expand Down
2 changes: 2 additions & 0 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"build:dev": "./node_modules/.bin/docusaurus build --dev && yarn run process-markdown",
"build:preview": "yarn run process-markdown && ./node_modules/.bin/docusaurus build --locale en && yarn run process-markdown",
"process-markdown": "node ./scripts/copy-md-to-static.js",
"meilisearch:build-index": "node scripts/index-meilisearch.mjs",
"swizzle": "docusaurus swizzle",
"docusaurus": "docusaurus"
},
Expand Down Expand Up @@ -49,6 +50,7 @@
"gleap": "^13.7.3",
"lodash": "^4.17.21",
"lucide-react": "^0.555.0",
"meilisearch": "^0.55.0",
"monaco-editor": "^0.55.1",
"near-api-js": "^7.0.0",
"near-connect-hooks": "^1.0.2",
Expand Down
Loading
Loading