Skip to content

Commit

Permalink
Use component titles for all tags (#64)
Browse files Browse the repository at this point in the history
* Use component titles for all tags

* Exclude Cloud labs from suggested in Enterprise

* Bump version
  • Loading branch information
JakeSCahill authored Aug 1, 2024
1 parent d8fb4c0 commit 9c3a3c4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion extensions/algolia-indexer/generate-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ function generateIndex (playbook, contentCatalog, { indexLatestOnly = false, exc
indexItem.deployment = deployment;
indexItem.type = 'Lab';
indexItem.interactive = false;
indexItem._tags = ['labs'];
indexItem._tags = [tag];
}
algolia[cname][version].push(indexItem)
algoliaCount++
Expand Down
7 changes: 4 additions & 3 deletions extensions/find-related-labs.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports.register = function ({ config }) {
const logger = this.getLogger('related-labs-extension');

this.on('documentsConverted', async ({ contentCatalog, siteCatalog }) => {
const docs = contentCatalog.findBy({ component: 'ROOT', family: 'page' });
const docs = contentCatalog.findBy({ family: 'page' });
docs.forEach((docPage) => {
const relatedLabs = []
const sourceAttributes = docPage.asciidoc.attributes
Expand All @@ -31,7 +31,7 @@ function findRelated(labPage, sourceCategoryList, sourceDeploymentType, logger)
const targetCategoryList = pageCategories.split(',').map(c => c.trim());
const targetDeploymentType = getDeploymentType(targetAttributes)
const categoryMatch = hasMatchingCategory(sourceCategoryList, targetCategoryList)
if (categoryMatch && (!targetDeploymentType ||sourceDeploymentType === targetDeploymentType || targetDeploymentType === 'Docker')) {
if (categoryMatch && (!targetDeploymentType ||sourceDeploymentType === targetDeploymentType || (targetDeploymentType === 'Docker' && !sourceDeploymentType))) {
return {
title: labPage.asciidoc.doctitle,
url: labPage.pub.url,
Expand All @@ -45,7 +45,8 @@ function getDeploymentType (attributes) {
return attributes['env-kubernetes'] ? 'Kubernetes'
: attributes['env-linux'] ? 'Linux'
: attributes['env-docker'] ? 'Docker'
: attributes.cloud ? 'Redpanda Cloud' : ''
: attributes['env-cloud'] ? 'Redpanda Cloud'
: attributes['page-cloud'] ? 'Redpanda Cloud' : ''
}

function hasMatchingCategory (sourcePageCategories, targetPageCategories) {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@redpanda-data/docs-extensions-and-macros",
"version": "3.5.7",
"version": "3.5.8",
"description": "Antora extensions and macros developed for Redpanda documentation.",
"keywords": [
"antora",
Expand Down

0 comments on commit 9c3a3c4

Please sign in to comment.