Skip to content

Commit

Permalink
Merge branch '4.0.x' into 5.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
fdevans committed Jan 31, 2025
2 parents 4329011 + f587669 commit 05e2e52
Show file tree
Hide file tree
Showing 145 changed files with 2,624 additions and 1,073 deletions.
7 changes: 6 additions & 1 deletion .docsearch/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"version": [
"docs",
"4.0.x",
"5.7.0"
"5.8.0"
]
}
}
Expand All @@ -19,6 +19,11 @@
"selectors": {
"default": {
"lvl0": {
"selector": ".vp-sidebar-links > li:first-child > .vp-sidebar-group > .vp-sidebar-header > .vp-sidebar-title",
"global": true,
"default_value": "Documentation"
},
"lvl1": {
"selector": ".theme-hope-content h1",
"global": true,
"default_value": "Documentation"
Expand Down
72 changes: 70 additions & 2 deletions docs/.vuepress/client.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { defineClientConfig } from '@vuepress/client'
import '@docsearch/css'

declare const VERSION: string;
declare const VERSION_FULL: string;
Expand All @@ -8,6 +9,7 @@ declare const API_DEP_VERSION: string;
declare const API_VERSION: string;
declare const CLI_VERSION: string;


export default defineClientConfig({
enhance({ app, router, siteData }) {
Object.defineProperties(app.config.globalProperties, {
Expand All @@ -18,9 +20,75 @@ export default defineClientConfig({
$apiDepVersion: { get: () => API_DEP_VERSION },
$apiVersion: { get: () => API_VERSION },
$cliVersion: { get: () => CLI_VERSION },

});

// The section below is used to properly format the Search results on the docs site.
if (typeof window !== 'undefined') {
// Monitor XHR requests
const originalXHR = window.XMLHttpRequest;
function newXHR() {
const xhr = new originalXHR();

xhr.addEventListener('load', function () {
if (xhr.responseURL?.includes('algolia')) {
try {
const data = JSON.parse(xhr.responseText);
if (data.results?.[0]?.hits) {
setTimeout(() => {
const hits = document.querySelectorAll('.DocSearch-Hit:empty');
hits.forEach((hit, index) => {
const hitData = data.results[0].hits[index];
if (hitData) {
const link = document.createElement('a');
link.href = hitData.url;
link.className = 'DocSearch-Hit-Container';

const title = hitData.hierarchy.lvl1 || hitData.hierarchy.lvl0;
const content = hitData.content;

link.innerHTML = `
<div class="DocSearch-Hit-icon">
<svg width="20" height="20" viewBox="0 0 20 20">
<path d="M17 5H3h14zm0 5H3h14zm0 5H3h14z" stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linejoin="round"></path>
</svg>
</div>
<div class="DocSearch-Hit-content-wrapper">
<span class="DocSearch-Hit-title">${title}</span>
<span class="DocSearch-Hit-path">${content}</span>
</div>
<div class="DocSearch-Hit-action">
<svg class="DocSearch-Hit-Select-Icon" width="20" height="20" viewBox="0 0 20 20">
<g stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round">
<path d="M18 3v4c0 2-2 4-4 4H2"></path>
<path d="M8 17l-6-6 6-6"></path>
</g>
</svg>
</div>
`;

hit.appendChild(link);

// Make the link clickable
link.addEventListener('click', (e) => {
e.preventDefault();
window.location.href = hitData.url;
});
}
});
}, 100);
}
} catch (e) {
console.error('Error processing response:', e);
}
}
});

return xhr;
}

window.XMLHttpRequest = newXHR as any;
}
},
setup() {},
setup() { },
rootComponents: [],
})
18 changes: 18 additions & 0 deletions docs/.vuepress/components/CustomNavBar.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<template>
<Navbar>
<template #endBefore>
<div class="vp-nav-links">
<NavbarDropdown :config="links"></NavbarDropdown>
</div>
</template>
</Navbar>

</template>

<script setup lang="ts">
import Navbar from "vuepress-theme-hope/modules/navbar/components/Navbar.js";
import NavbarDropdown from "vuepress-theme-hope/modules/navbar/components/NavbarDropdown.js";
import previousVersions from '../navbar-menus/previous-versions'
const links = { text: "Archive", children: previousVersions}
</script>
101 changes: 0 additions & 101 deletions docs/.vuepress/components/DocVersions.vue

This file was deleted.

2 changes: 1 addition & 1 deletion docs/.vuepress/components/SidebarAnnounce.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<p>
<b>Process Automation On Prem</b> is now <b>Runbook Automation Self-Hosted</b>
</p>
</div>
</div>
</template>
</AnnounceBox>
</template>
Expand Down
Loading

0 comments on commit 05e2e52

Please sign in to comment.