Skip to content

Commit 4d6c42a

Browse files
g-francescaShubhamOulkarbjohansebas
authored
feat(redesign): search/chat widget powered by Orama (#2213)
Co-authored-by: Shubham Oulkar <oulkarshubhu@gmail.com> Co-authored-by: Sebastian Beltran <bjohansebas@gmail.com>
1 parent ad775da commit 4d6c42a

32 files changed

Lines changed: 9533 additions & 6454 deletions

.github/workflows/sync-orama.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Sync Orama Cloud
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- redesign
8+
pull_request:
9+
branches:
10+
- redesign
11+
12+
permissions:
13+
contents: read
14+
15+
concurrency:
16+
group: "${{ github.workflow }} ✨ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
17+
cancel-in-progress: ${{ github.event_name != 'push' }}
18+
19+
jobs:
20+
sync-orama-cloud:
21+
name: Sync Orama Cloud
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- uses: actions/checkout@v6
26+
with:
27+
persist-credentials: false
28+
29+
- name: Set up Node.js
30+
uses: actions/setup-node@v6
31+
with:
32+
# node-version-file: ".nvmrc" use when .nvmrc is on root of the repo
33+
node-version: "24.13"
34+
# cache: "npm" use when package-lock.json is on root of the repo
35+
36+
- name: Install Node.js dependencies
37+
working-directory: astro
38+
run: npm ci
39+
40+
- name: Sync Orama Cloud
41+
working-directory: astro
42+
run: node ./scripts/sync-orama.mjs
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
PUBLIC_ORAMA_PROJECT_ID: ${{ github.event_name == 'push' && secrets.PUBLIC_ORAMA_PRODUCTION_PROJECT_ID || secrets.PUBLIC_ORAMA_PROJECT_ID }}
46+
PRIVATE_ORAMA_API_KEY: ${{ github.event_name == 'push' && secrets.PRIVATE_ORAMA_PRODUCTION_API_KEY || secrets.PRIVATE_ORAMA_API_KEY }}
47+
PUBLIC_ORAMA_DATASOURCE_ID: ${{ github.event_name == 'push' && secrets.PUBLIC_ORAMA_PRODUCTION_DATASOURCE_ID || secrets.PUBLIC_ORAMA_DATASOURCE_ID }}

astro/astro.config.mjs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ import mdx from '@astrojs/mdx';
44
import sitemap from '@astrojs/sitemap';
55
import icon from 'astro-icon';
66
import expressiveCode from 'astro-expressive-code';
7+
import react from '@astrojs/react';
8+
import svgr from 'vite-plugin-svgr';
9+
import Icons from 'unplugin-icons/vite';
710

811
// TODO: add redirecto for blog posts
912

@@ -15,6 +18,16 @@ const site = NETLIFY_PREVIEW_SITE || 'https://expressjs.com';
1518
// https://astro.build/config
1619
export default defineConfig({
1720
site,
21+
vite: {
22+
plugins: [
23+
// Transforms SVG files imported with the `?react` suffix into React components
24+
// (used for local SVG assets like logos).
25+
svgr(),
26+
// Resolves `~icons/collection/icon-name` imports into React components,
27+
// bundling only the SVG paths for icons actually used (no full icon set in the bundle).
28+
Icons({ compiler: 'jsx', jsx: 'react' }),
29+
],
30+
},
1831
integrations: [
1932
expressiveCode({
2033
themes: ['github-dark'],
@@ -27,6 +40,7 @@ export default defineConfig({
2740
}),
2841
mdx(),
2942
icon(),
43+
react(),
3044
sitemap({
3145
i18n: {
3246
defaultLocale: 'en',

0 commit comments

Comments
 (0)