Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions astro-docs/public/global-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
let lastSearchQuery = '';
let currentSearchInput = null;
let inputHandler = null;
let resultClickHandler = null;

function sendSearchEvent(eventType, data) {
pushGtmEvent(eventType, data);
Expand All @@ -150,8 +151,8 @@
clearTimeout(searchDebounceTimer);
searchDebounceTimer = setTimeout(() => {
lastSearchQuery = query;
sendSearchEvent('search_query', {
query: query,
sendSearchEvent('search', {
search_term: query,
});
}, SEARCH_DEBOUNCE_MS);
}
Expand All @@ -175,12 +176,30 @@
searchInput.addEventListener('input', inputHandler);
currentSearchInput = searchInput;
}

// Track search result clicks via event delegation
if (!resultClickHandler) {
resultClickHandler = (e) => {
const link = e.target.closest('a[href]');
if (!link) return;
const query = currentSearchInput
? currentSearchInput.value.trim()
: '';
pushGtmEvent('select_content', {
content_type: 'search_result',
item_id: link.getAttribute('href'),
search_term: query,
});
};
searchDialog.addEventListener('click', resultClickHandler);
}
}
// If dialog is not found but we have handler, etc. then it must be closed and we should clean up
else if (currentSearchInput && inputHandler) {
currentSearchInput.removeEventListener('input', inputHandler);
currentSearchInput = null;
inputHandler = null;
resultClickHandler = null;
}
});

Expand Down
4 changes: 4 additions & 0 deletions astro-docs/sidebar.mts
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,10 @@ const knowledgeBaseGroups: SidebarItems = [
label: 'Launch templates',
link: 'reference/nx-cloud/launch-templates',
},
{
label: 'Launch template examples',
link: 'reference/nx-cloud/launch-template-examples',
},
{
label: 'Reduce waste in CI',
link: 'concepts/ci-concepts/reduce-waste',
Expand Down
4 changes: 3 additions & 1 deletion astro-docs/src/content.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ const searchSchema = z.object({
.min(0, 'Search weight cannot be lower than 0')
.max(10, 'Search weight cannot be higher than 10')
.optional(),
filter: z.string().optional(),
filter: z
.enum(['type:Concepts', 'type:Features', 'type:Guides', 'type:References'])
.optional(),
});

const customDocsSchema = z
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: GitHub App Permissions
description: A detailed breakdown of each permission the Nx Cloud GitHub App requires and why.
filter: 'type:Reference'
filter: 'type:References'
---

The Nx Cloud GitHub App requires the following permissions to provide CI/CD integration and setup experiences. Most information is used transiently during operations and not stored in our systems.
Expand Down
Loading
Loading