Skip to content

Commit

Permalink
Add SDK docs to Algolia search (#11188)
Browse files Browse the repository at this point in the history
* Add SDK docs to Algolia search
* Add Node keywords
  • Loading branch information
cnunciato authored Apr 5, 2024
1 parent 7abf393 commit ff5d580
Showing 1 changed file with 83 additions and 0 deletions.
83 changes: 83 additions & 0 deletions scripts/search/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,93 @@ const primaryPageObjects = page.getPrimaryObjects(hugoPageItems);
console.log(" ↳ Building secondary page objects...");
const secondaryPageObjects = page.getSecondaryObjects(primaryPageObjects);

// Incorporate any additional objects. This list is provided as a hand-crafted list for now, because pragmatism,
// but it should probably be pulled out into a proper module at some point.
const additionalObjects = [
{
"section": "Docs",
"title": "Pulumi Node.js SDK Documentation",
"description": "Documentation for the Pulumi Node.js SDK.",
"href": "/docs/reference/pkg/nodejs/pulumi/pulumi/",
"keywords": [
"@pulumi/pulumi",
"javascript sdk",
"typescript sdk",
"nodejs sdk",
"node sdk",
"sdk",
],
"ancestors": [
"Docs",
"Languages & SDKs",
"TypeScript (Node.js)"
],
},
{
"section": "Docs",
"title": "Pulumi Python SDK Documentation",
"description": "Documentation for the Pulumi Python SDK.",
"href": "/docs/reference/pkg/python/pulumi/",
"keywords": [
"pulumi_pulumi",
"python sdk",
"sdk",
],
"ancestors": [
"Docs",
"Languages & SDKs",
"Python"
],
},
{
"section": "Docs",
"title": "Pulumi Go SDK Documentation",
"description": "Documentation for the Pulumi Go SDK.",
"href": "https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/pulumi",
"rank": 860, // The default ranking for docs. (See rank.js.)
"keywords": [
"go sdk",
"golang sdk",
"sdk",
],
"ancestors": [
"Docs",
"Languages & SDKs",
"Go"
],
},
{

"section": "Docs",
"title": "Pulumi .NET SDK Documentation (C#, VB, F#)",
"description": "Documentation for the Pulumi .NET SDK.",
"href": "/docs/reference/pkg/dotnet/Pulumi/Pulumi.html",
"keywords": [
"Pulumi.Pulumi",
".net sdk",
"c# sdk",
"vb sdk",
"f# sdk",
"sdk"
],
"ancestors": [
"Docs",
"Languages & SDKs",
".NET (C#, VB, F#)"
],
},
].map(item => {
return {
"objectID": page.getObjectID({ href: item.href }),
...item,
};
});

// Stitch these lists together into one tidy bundle.
let allObjects = [
...primaryPageObjects,
...secondaryPageObjects,
...additionalObjects,
];

// Temporary hack: Remove any references to `azure-native-v1`. This line can be
Expand Down

0 comments on commit ff5d580

Please sign in to comment.