Skip to content

Commit d68d009

Browse files
committed
refactor: Remove unused code and update js dependencies
1 parent fc2c49c commit d68d009

File tree

8 files changed

+1
-263
lines changed

8 files changed

+1
-263
lines changed

antora-ui/src/css/algolia-extra.css

Lines changed: 0 additions & 67 deletions
This file was deleted.

antora-ui/src/css/site.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,3 @@
1818
@import "tailwindcss/base";
1919
@import "tailwindcss/components";
2020
@import "tailwindcss/utilities";
21-
@import "algolia-extra.css";

antora-ui/src/layouts/default.hbs

Lines changed: 1 addition & 137 deletions
Original file line numberDiff line numberDiff line change
@@ -2,146 +2,10 @@
22
<html lang="en">
33
<head>
44
{{> head defaultPageTitle='Untitled'}}
5-
<style>
6-
.algolia-autocomplete .ds-dropdown-menu:before {
7-
display: block;
8-
position: absolute;
9-
content: "";
10-
width: 14px;
11-
height: 14px;
12-
background: #fff;
13-
z-index: 2;
14-
top: 9px;
15-
left: -7px !important;
16-
border-top: 1px solid #d9d9d9;
17-
border-right: 1px solid #d9d9d9;
18-
-webkit-transform: rotate(-136deg);
19-
transform: rotate(-136deg);
20-
border-radius: 2px;
21-
}
22-
.search-result-dropdown-menu:before {
23-
display: block;
24-
position: absolute;
25-
content: "";
26-
width: 14px;
27-
height: 14px;
28-
background: #fff !important;
29-
z-index: 2;
30-
top: 9px;
31-
border-top: 1px solid #d9d9d9;
32-
border-right: 1px solid #d9d9d9;
33-
-webkit-transform: rotate(-136deg);
34-
transform: rotate(-136deg);
35-
border-radius: 2px;
36-
left: -7px;
37-
}
38-
.nav-container .search-result-dropdown-menu {
39-
position: fixed;
40-
top: 65px;
41-
left: 13.5rem;
42-
width: 50%;
43-
overflow: visible;
44-
max-height: calc(100vh - 5.25rem);
45-
line-height: 1.5;
46-
z-index: 9999;
47-
}
48-
.nav-container .button {
49-
padding: 0px 14px;
50-
background-color: #FF9F00;
51-
color: #fff;
52-
}
53-
.algolia-autocomplete.algolia-autocomplete-left .ds-dropdown-menu {
54-
position: fixed !important;
55-
top: 65px !important;
56-
left: 13.5rem !important;
57-
z-index: 99 !important;
58-
}
59-
.search-selector {
60-
margin-right: 133px;
61-
text-transform: none;
62-
}
63-
@media screen and (max-width: 1024px) {
64-
.nav-container .search-result-dropdown-menu {
65-
top: 103px;
66-
left: 14.5rem;
67-
}
68-
}
69-
@media screen and (max-width: 768px) {
70-
.search-result-dropdown-menu:before {
71-
top: -6px;
72-
-webkit-transform: rotate(-45deg);
73-
transform: rotate(-45deg);
74-
left: 35px;
75-
}
76-
.nav-container .search-result-dropdown-menu {
77-
top: 100%;
78-
left: 0;
79-
width: 90vw;
80-
position: absolute !important;
81-
}
82-
.algolia-autocomplete.algolia-autocomplete-left .ds-dropdown-menu {
83-
position: absolute !important;
84-
top: 100% !important;
85-
left: 0px !important;
86-
z-index: 99 !important;
87-
}
88-
.algolia-autocomplete .ds-dropdown-menu:before{
89-
top: -6px;
90-
-webkit-transform: rotate(-45deg);
91-
transform: rotate(-45deg);
92-
left: 35px !important;
93-
}
94-
}
95-
</style>
965
</head>
976
<body class="article{{#with (or page.attributes.role page.role)}} {{{this}}}{{/with}}">
987
{{> header}}
998
{{> body}}
100-
<script>
101-
var element = document.querySelector('.search-result-dropdown-menu');
102-
if (element) {
103-
// Apply styles and additional class to element
104-
element.style.display = 'none';
105-
var element = document.querySelector('.search-result-dropdown-menu');
106-
var arrow = document.createElement('div');
107-
arrow.classList.add('search-result-dropdown-menu');
108-
element.appendChild(arrow);
109-
}
110-
111-
function onSearch() {
112-
var searchInput = document.getElementById('search-input');
113-
if (searchInput.value) {
114-
element.style.display = 'block';
115-
} else {
116-
element.style.display = 'none';
117-
}
118-
}
119-
120-
function onSearchChange(search_active) {
121-
var searchInputAlgolia = document.getElementById('search-input-algolia');
122-
var searchInput = document.getElementById('search-input');
123-
if (search_active === "algolia") {
124-
searchInputAlgolia.style.display = 'block';
125-
// searchInputAlgolia.style.lineHeight = '2.001';
126-
searchInput.style.display = 'none';
127-
setupAlgoliaDocsearch();
128-
} else {
129-
searchInputAlgolia.style.display = 'none';
130-
searchInput.style.display = 'block';
131-
}
132-
}
133-
134-
// Add an event listener to the document
135-
document.addEventListener("click", function(event) {
136-
var searchInput = document.getElementById('search-input');
137-
// Check if the click was outside of the modal
138-
if (event.target !== element && event.target !== searchInput) {
139-
140-
// Hide the modal
141-
searchInput.value = "";
142-
onSearch();
143-
}
144-
});
145-
</script>
9+
{{> footer}}
14610
</body>
14711
</html>

antora-ui/src/partials/footer-scripts.hbs

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,3 @@
1-
{{#if env.ALGOLIA_API_KEY}}
2-
<script src="https://cdn.jsdelivr.net/npm/docsearch.js@2.5.2/dist/cdn/docsearch.min.js"></script>
3-
<script>
4-
function setupAlgoliaDocsearch(){
5-
document.getElementById('search-input').hidden = true;
6-
document.getElementById('search-input-algolia').hidden = false;
7-
var search = docsearch({
8-
{{#with env.ALGOLIA_APP_ID}}
9-
appId: '{{this}}',
10-
{{/with}}
11-
apiKey: '{{env.ALGOLIA_API_KEY}}',
12-
indexName: '{{env.ALGOLIA_IDX_NAME}}',
13-
inputSelector: '#search-input-algolia',
14-
autocompleteOptions: { hint: false, keyboardShortcuts: ['s'] },
15-
algoliaOptions: { hitsPerPage: 10 ,facetFilters: ['version:{{page.componentVersion.displayVersion}}'] },
16-
}).autocomplete
17-
search.on('autocomplete:closed', function () { search.autocomplete.setVal() });
18-
}
19-
20-
function setCookie(name, value) {
21-
document.cookie = name + "=" + (value || "") + "; path=/";
22-
}
23-
24-
function getCookie(name) {
25-
var nameEQ = name + "=";
26-
var ca = document.cookie.split(';');
27-
for (var i = 0; i < ca.length; i++) {
28-
var c = ca[i];
29-
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
30-
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
31-
}
32-
return null;
33-
}
34-
</script>
35-
{{/if}}
361
<script id="site-script" src="{{{uiRootPath}}}/js/site.js" data-ui-root-path="{{{uiRootPath}}}"></script>
372
<script async src="{{{uiRootPath}}}/js/vendor/highlight.js"></script>
383
{{#if env.SITE_SEARCH_PROVIDER}}

antora-ui/src/partials/footer.hbs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
{{> footer-content}}
21
{{> footer-scripts}}

antora-ui/src/partials/head.hbs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@
22
{{> head-title}}
33
{{> head-info}}
44
{{> head-styles}}
5-
{{> head-meta}}
65
{{> head-scripts}}
76
{{> head-icons}}

antora-ui/src/partials/nav-menu.hbs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,5 @@
11
{{#with page.navigation}}
22
<div class="nav-panel-menu is-active" data-panel="menu">
3-
<div class="navbar-item search hide-for-print">
4-
<div id="search-field" class="field has-filter">
5-
<div style="display: flex; flex-direction: column;">
6-
<div style="display: flex; margin-bottom: 10px; position: relative;">
7-
<input id="search-input" type="text" placeholder="Search the docs"{{#if page.home}} autofocus{{/if}} style="flex: 1; padding: 0 0.25em" onkeyup="onSearch()">
8-
<input id="search-input-algolia" type="text" placeholder="Search the docs"{{#if page.home}} autofocus{{/if}} hidden style="flex: 1;">
9-
</div>
10-
<div style="display: flex; margin-bottom: 10px; justify-content: space-evenly;">
11-
<select class="search-selector" onchange="onSearchChange(this.value)">
12-
<option value="lunr">Lunr</option>
13-
<option value="algolia">Algolia</option>
14-
</select>
15-
</div>
16-
</div>
17-
</div>
18-
</div>
193
<nav class="nav-menu">
204
{{#with @root.page.componentVersion}}
215
<h3 class="title"><a href="{{{relativize ./url}}}">{{./title}}</a></h3>

sitedoc.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,6 @@ if [ ! -d "node_modules" ] || [ "$(find package.json -prune -printf '%T@\n' | cu
7777
npm ci
7878
fi
7979

80-
# TODO: Find a better way of setting these
81-
export ALGOLIA_APP_ID="HXFFX7FZYE"
82-
export ALGOLIA_API_KEY="6a58e88f13574fdb9b18ca0159e896b4"
83-
export ALGOLIA_IDX_NAME="cppalliancedocs"
84-
8580
echo $ANTORA_CMD --fetch --attribute page-boost-branch="$1" --attribute page-commit-id="$commit_id" site.playbook.yml
8681
$ANTORA_CMD --fetch --attribute page-boost-branch="$1" --attribute page-commit-id="$commit_id" site.playbook.yml
8782

0 commit comments

Comments
 (0)