Skip to content

Commit 39c04ad

Browse files
authored
Merge pull request #5 from owncloud/integrate-lunr-search
Integrate lunr search
2 parents 2122bb2 + 0ebd67a commit 39c04ad

File tree

10 files changed

+12436
-24
lines changed

10 files changed

+12436
-24
lines changed

package-lock.json

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

package.json

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
{
2-
"name": "antora-ui-default",
3-
"description": "An archetype project that produces a UI for creating documentation sites with Antora",
4-
"homepage": "https://gitlab.com/antora/antora-ui-default",
5-
"license": "MPL-2.0",
6-
"repository": {
7-
"type": "git",
8-
"url": "https://gitlab.com/antora/antora-ui-default.git"
9-
},
10-
"engines": {
11-
"node": ">= 8.0.0"
2+
"name": "owncloud-docs-ui",
3+
"version": "1.0.0",
4+
"description": "The custom ownCloud Documentation UI Theme",
5+
"directories": {
6+
"doc": "docs"
127
},
13-
"devDependencies": {
8+
"dependencies": {
9+
"antora-lunr": "v0.1.0",
1410
"autoprefixer": "^7.1.6",
1511
"browserify": "^14.5.0",
1612
"chokidar": "^2.0.1",
@@ -33,6 +29,7 @@
3329
"handlebars": "^4.0.10",
3430
"highlight.js": "^9.12.0",
3531
"js-yaml": "^3.10.0",
32+
"lunr": "^2.2.0",
3633
"map-stream": "^0.0.7",
3734
"merge-stream": "^1.0.1",
3835
"postcss-calc": "^6.0.1",
@@ -47,5 +44,26 @@
4744
"typeface-roboto-mono": "^0.0.44",
4845
"vinyl-buffer": "^1.0.0",
4946
"vinyl-fs": "^2.4.4"
50-
}
47+
},
48+
"devDependencies": {},
49+
"scripts": {
50+
"test": "echo \"Error: no test specified\" && exit 1"
51+
},
52+
"repository": {
53+
"type": "git",
54+
"url": "git+https://github.com/owncloud/docs-ui.git"
55+
},
56+
"keywords": [
57+
"owncloud",
58+
"antora",
59+
"asciidoc",
60+
"documentation",
61+
"lunr"
62+
],
63+
"author": "Matthew Setter <[email protected]>",
64+
"license": "AGPL-3.0",
65+
"bugs": {
66+
"url": "https://github.com/owncloud/docs-ui/issues"
67+
},
68+
"homepage": "https://github.com/owncloud/doc-uis#readme"
5169
}

preview-site-src/ui-model.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ site:
88
url: '#'
99
versions:
1010
- &latest_version_abc
11-
url: '#'
11+
url: '#'
1212
version: '1.1'
13-
- url: '#'
13+
- url: '#'
1414
version: '1.0'
1515
latestVersion: *latest_version_abc
1616
- &component
@@ -22,23 +22,23 @@ site:
2222
url: /xyz/6.0/index.html
2323
version: '6.0'
2424
- &component_version
25-
url: '#'
25+
url: '#'
2626
version: '5.2'
27-
- url: '#'
27+
- url: '#'
2828
version: '5.1'
29-
- url: '#'
29+
- url: '#'
3030
version: '5.0'
3131
latestVersion: *latest_version_xyz
3232
- name: 123
3333
title: Project 123
3434
url: '#'
3535
versions:
3636
- &latest_version_123
37-
url: '#'
37+
url: '#'
3838
version: '2.2'
39-
- url: '#'
39+
- url: '#'
4040
version: '2.1'
41-
- url: '#'
41+
- url: '#'
4242
version: '2.0'
4343
latestVersion: *latest_version_123
4444
page:

src/css/header.css

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,3 +285,115 @@ body {
285285
padding: 0 0.75em;
286286
white-space: nowrap;
287287
}
288+
289+
.navbar-brand .navbar-item + .navbar-item {
290+
flex-grow: 1;
291+
justify-content: flex-end;
292+
}
293+
294+
.algolia-autocomplete .ds-dropdown-menu [class^=ds-dataset-] {
295+
max-height: calc(100vh - 3.25rem);
296+
}
297+
298+
@media screen and (max-width: 768px) {
299+
.navbar-brand .navbar-item + .navbar-item {
300+
padding-left: 0;
301+
padding-right: 0;
302+
}
303+
304+
.algolia-autocomplete .ds-dropdown-menu {
305+
min-width: calc(100vw - 2.75rem) !important;
306+
}
307+
}
308+
309+
@media screen and (min-width: 1024px) {
310+
.navbar-brand {
311+
flex-grow: 1;
312+
}
313+
314+
.navbar-menu {
315+
flex-grow: 0;
316+
}
317+
}
318+
319+
#search-input {
320+
color: #333;
321+
font-family: inherit;
322+
font-size: 0.95rem;
323+
border: 1px solid #dbdbdb;
324+
border-radius: 0.1em;
325+
line-height: 1.5;
326+
padding: 0 0.25em;
327+
width: 100%;
328+
}
329+
330+
@media screen and (min-width: 769px) {
331+
#search-input {
332+
width: 100%;
333+
}
334+
}
335+
336+
.search-result-dropdown-menu {
337+
position: absolute;
338+
z-index: 100;
339+
display: block;
340+
right: 0;
341+
left: inherit;
342+
top: 100%;
343+
border-radius: 4px;
344+
margin: 6px 0 0;
345+
padding: 0;
346+
text-align: left;
347+
height: auto;
348+
background: transparent;
349+
border: none;
350+
max-width: 600px;
351+
min-width: 500px;
352+
box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.2), 0 2px 3px 0 rgba(0, 0, 0, 0.1);
353+
}
354+
355+
.search-result-dataset {
356+
position: relative;
357+
border: 1px solid #d9d9d9;
358+
background: #fff;
359+
border-radius: 4px;
360+
overflow: auto;
361+
padding: 0 8px 8px;
362+
max-height: calc(100vh - 3.25rem);
363+
color: #333;
364+
}
365+
366+
.search-result-highlight {
367+
color: #174d8c;
368+
background: rgba(143, 187, 237, 0.1);
369+
}
370+
371+
.search-result-item {
372+
display: flex;
373+
font-size: 1rem;
374+
margin-bottom: 0.5rem;
375+
margin-top: 0.5rem;
376+
}
377+
378+
.search-result-document-title {
379+
max-width: 40%;
380+
border-right: 1px solid #999;
381+
padding-right: 0.5rem;
382+
color: #999;
383+
font-size: 0.8rem;
384+
width: 40%;
385+
}
386+
387+
.search-result-document-hit {
388+
padding-left: 1rem;
389+
font-size: 0.9rem;
390+
width: 60%;
391+
}
392+
393+
.search-result-document-hit > a {
394+
color: inherit;
395+
}
396+
397+
.search-result-document-hit > a:hover {
398+
background-color: rgba(69, 142, 225, 0.05);
399+
}

src/extra/search_index.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)