Skip to content

Commit 42a9fe1

Browse files
Merge pull request #127 from anveshmuppeda/dev
Adding Search Feature to Website
2 parents fb5c3ed + a6802a2 commit 42a9fe1

File tree

6 files changed

+2168
-699
lines changed

6 files changed

+2168
-699
lines changed

.github/workflows/deploy.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ name: Deploy to GitHub Pages
22

33
on:
44
workflow_dispatch:
5-
# This workflow is triggered on push events to the main branch
6-
# and only for specific paths. You can customize the paths as needed.
75
push:
86
branches:
97
- main
@@ -13,30 +11,36 @@ on:
1311
- 'static/**'
1412
- 'blog/**'
1513
- 'commands/**'
16-
- 'k8swebsite.config.js'
14+
- 'k8swebsite.config.ts'
1715
- 'package.json'
1816
- 'sidebars.ts'
19-
# Review gh actions docs if you want to further define triggers, paths, etc
20-
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
17+
- '.github/workflows/deploy.yml'
2118

2219
jobs:
2320
build:
24-
name: Build Docusaurus
21+
name: Build Kubernetes Website
2522
runs-on: ubuntu-latest
2623
steps:
24+
# Step 1: Checkout the repository
2725
- uses: actions/checkout@v4
2826
with:
2927
fetch-depth: 0
28+
29+
# Step 2: Set up Node.js
3030
- uses: actions/setup-node@v4
3131
with:
3232
node-version: 18
3333
cache: npm
3434

35+
# Step 3: Install dependencies
3536
- name: Install dependencies
36-
run: npm ci
37+
run: npm ci --legacy-peer-deps
38+
39+
# Step 4: Build the website
3740
- name: Build website
3841
run: npm run build
3942

43+
# Step 5: Upload the build artifact
4044
- name: Upload Build Artifact
4145
uses: actions/upload-pages-artifact@v3
4246
with:
@@ -58,6 +62,7 @@ jobs:
5862

5963
runs-on: ubuntu-latest
6064
steps:
65+
# Step 6: Deploy to GitHub Pages
6166
- name: Deploy to GitHub Pages
6267
id: deployment
6368
uses: actions/deploy-pages@v4

k8swebsite.config.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,14 @@ const config: Config = {
8282
editUrl: 'https://github.com/anveshmuppeda/kubernetes/tree/dev/',
8383
},
8484
],
85+
[
86+
require.resolve('docusaurus-lunr-search'),
87+
{
88+
languages: ['en', 'fr'], // English and French
89+
highlightResult: true, // Highlight search results
90+
maxHits: 10, // Show up to 10 results
91+
},
92+
],
8593
],
8694

8795
themeConfig: {
@@ -111,6 +119,10 @@ const config: Config = {
111119
label: 'GitHub',
112120
position: 'right',
113121
},
122+
{
123+
type: 'search', // Add the search bar to the navbar
124+
position: 'right',
125+
},
114126
],
115127
},
116128
footer: {
@@ -140,10 +152,6 @@ const config: Config = {
140152
label: 'LinkedIn',
141153
href: 'https://www.linkedin.com/in/anveshmuppeda/',
142154
},
143-
{
144-
label: 'GitHub',
145-
href: 'https://github.com/anveshmuppeda',
146-
},
147155
{
148156
label: 'Stack Overflow',
149157
href: 'https://stackoverflow.com/users/16485310/anvesh-muppeda',

0 commit comments

Comments
 (0)