Skip to content

Commit a69212a

Browse files
Copilotriccardobl
andcommitted
Replace search with pagefind
Co-authored-by: riccardobl <4943530+riccardobl@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: riccardobl <4943530+riccardobl@users.noreply.github.com>
1 parent cb8e4b2 commit a69212a

File tree

10 files changed

+309
-584
lines changed

10 files changed

+309
-584
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
strategy:
3636
matrix:
3737
#Static version is used to maintain stability.
38-
node-version: [12.17.0]
38+
node-version: [20.x]
3939

4040
env:
4141
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
@@ -49,9 +49,10 @@ jobs:
4949
fetch-depth: 1
5050

5151
- name: Use Node.js ${{ matrix.node-version }}
52-
uses: actions/setup-node@v1
52+
uses: actions/setup-node@v4
5353
with:
5454
node-version: ${{ matrix.node-version }}
55+
cache: npm
5556

5657
# Display the sha of the build triggering the repository_dispatch event.
5758
- name: wiki-ui-build

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20

package-lock.json

Lines changed: 146 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@
88
"lib": "lib"
99
},
1010
"scripts": {
11-
"buildDocs": "npx antora --stacktrace wiki-playbook.yml"
11+
"buildDocs": "npx antora --stacktrace wiki-playbook.yml && npx pagefind --site build/site"
1212
},
1313
"private": true,
14+
"engines": {
15+
"node": ">=20"
16+
},
1417
"repository": {
1518
"type": "git",
1619
"url": "git+https://github.com/jMonkeyEngine/wiki.git"
@@ -24,6 +27,7 @@
2427
"homepage": "https://github.com/jMonkeyEngine/wiki#readme",
2528
"dependencies": {
2629
"@antora/cli": "^3.0.1",
30+
"pagefind": "^1.4.0",
2731
"@antora/site-generator": "^3.0.1",
2832
"asciidoctor-emoji": "^0.3.4"
2933
}

supplemental-ui/css/site-extra.css

Lines changed: 68 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,11 @@
77
justify-content: flex-end;
88
}
99

10-
.algolia-autocomplete .ds-dropdown-menu [class^=ds-dataset-] {
11-
max-height: calc(100vh - 3.25rem);
12-
}
13-
1410
@media screen and (max-width: 768px) {
1511
.navbar-brand .navbar-item + .navbar-item {
1612
padding-left: 0;
1713
padding-right: 0;
1814
}
19-
20-
.algolia-autocomplete .ds-dropdown-menu {
21-
min-width: calc(100vw - 2.75rem) !important;
22-
}
2315
}
2416

2517
@media screen and (min-width: 1024px) {
@@ -36,20 +28,81 @@
3628
}
3729
}
3830

39-
#search-input {
31+
/* Pagefind search widget in navbar */
32+
#search {
33+
width: 200px;
34+
position: relative;
35+
}
36+
37+
#search .wiki-search-input {
4038
color: #333;
4139
font-family: inherit;
4240
font-size: 0.95rem;
43-
width: 100px;
41+
width: 100%;
4442
border: 1px solid #dbdbdb;
45-
border-radius: 0.1em;
43+
border-radius: 3px;
4644
line-height: 1.5;
47-
padding: 0 0.25em;
45+
padding: 0.25rem 0.4rem;
46+
background: #fff;
47+
}
48+
49+
#search .wiki-search-results {
50+
position: absolute;
51+
top: 100%;
52+
right: 0;
53+
width: 500px;
54+
max-width: 90vw;
55+
max-height: 70vh;
56+
overflow-y: auto;
57+
background: #fff;
58+
border: 1px solid #dbdbdb;
59+
border-radius: 4px;
60+
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
61+
z-index: 1000;
62+
padding: 0.5rem 1rem;
63+
margin-top: 0.25rem;
64+
}
65+
66+
#search .wiki-search-item {
67+
padding: 0.45rem 0;
68+
border-top: 1px solid #efefef;
69+
}
70+
71+
#search .wiki-search-item:first-child {
72+
border-top: 0;
4873
}
4974

50-
@media screen and (min-width: 769px) {
51-
#search-input {
52-
width: 200px;
75+
#search .wiki-search-link {
76+
color: #1a0dab;
77+
text-decoration: none;
78+
font-size: 0.95rem;
79+
font-weight: 600;
80+
}
81+
82+
#search .wiki-search-link:hover {
83+
text-decoration: underline;
84+
}
85+
86+
#search .wiki-search-excerpt {
87+
color: #333;
88+
margin: 0.2rem 0 0;
89+
font-size: 0.85rem;
90+
line-height: 1.35;
91+
}
92+
93+
#search .wiki-search-empty {
94+
color: #555;
95+
margin: 0;
96+
padding: 0.25rem 0;
97+
}
98+
99+
@media screen and (max-width: 768px) {
100+
#search {
101+
width: 100px;
102+
}
103+
#search .wiki-search-results {
104+
width: 300px;
105+
right: -50px;
53106
}
54107
}
55108

0 commit comments

Comments
 (0)