Skip to content

Commit

Permalink
feat: create new product nav data structure (#2537)
Browse files Browse the repository at this point in the history
  • Loading branch information
LeahMarieBush authored Aug 6, 2024
1 parent fc25707 commit 41d6f80
Show file tree
Hide file tree
Showing 2 changed files with 137 additions and 1 deletion.
107 changes: 106 additions & 1 deletion src/lib/products.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@
* SPDX-License-Identifier: MPL-2.0
*/

import { Product, ProductName, ProductSlug } from 'types/products'
import {
Product,
ProductName,
ProductSlug,
ProductNavData,
ProductNavPromo,
ProductSidePanel,
} from 'types/products'

/**
* A map of product slugs to their proper noun names.
Expand Down Expand Up @@ -39,6 +46,101 @@ const productSlugsToHostNames: { [slug in ProductSlug]: string } = {
waypoint: 'waypointproject.io',
}

const navigationData: ProductNavData = [
{
title: 'Infrastructure Lifecycle Management',
products: [
{
product: 'Terraform',
url: '/terraform',
description: 'Manage infrastructure as code',
},
{
product: 'Packer',
url: '/packer',
description: 'Build machine images',
},
{
product: 'Nomad',
url: '/nomad',
description: 'Orchestrate workloads',
},
{
product: 'Waypoint',
url: '/waypoint',
description: 'Standardize application patterns',
},
{
product: 'Vagrant',
url: '/vagrant',
description: 'Build developer environments',
},
],
},
{
title: 'Security Lifecycle Management',
products: [
{
product: 'Vault',
url: '/vault',
description: 'Centrally manage secrets',
},
{
product: 'Boundary',
url: '/boundary',
description: 'Secure remote access',
},
{
product: 'HCP Vault Secrets',
url: '/hcp/docs/vault-secrets',
description: 'Manage secrets as a service',
},
{
product: 'Consul',
url: '/consul',
description: 'Secure network services',
},
{
product: 'HCP Vault Radar',
url: '/hcp/docs/vault-radar',
description: 'Scan for embedded secrets',
},
],
},
]

const navPromo: ProductNavPromo = {
title: 'HashiCorp Cloud Platform',
description: 'Get started in minutes with our cloud products',
linkUrl: '/hcp',
linkTitle: 'All HCP Products',
icon: 'hashicorp',
theme: 'default',
}

const sidePanelContent: ProductSidePanel = {
title: 'Learn',
content: [
{
title: 'Certifications',
description: 'Get HashiCorp certified',
link: '/certifications',
icon: 'award',
},
{
title: 'Tutorials',
description: 'Learn HashiCorp products',
link: '/tutorials',
icon: 'learn',
},
{
title: 'Well-Architected Framework',
description: 'Adopt HashiCorp best practices',
link: '/well-architected-framework',
icon: 'layers',
},
],
}
/**
* Type guard to determine if a string is a ProductSlug
*
Expand Down Expand Up @@ -74,4 +176,7 @@ export {
productSlugs,
productSlugsToHostNames,
productSlugsToNames,
navigationData,
navPromo,
sidePanelContent,
}
31 changes: 31 additions & 0 deletions src/types/products.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,34 @@ interface ProductWithCurrentRootDocsPath extends ProductData {

type ProductGroup = Product[]

type ProductNavData = {
title: string
products: {
product: string
url: string
description: string
}[]
}[]

type ProductNavPromo = {
title: string
description: string
linkUrl: string
linkTitle: string
icon: string
theme: string
}

type ProductSidePanel = {
title: string
content: {
title: string
description: string
link: string
icon: string
}[]
}

export type {
LearnProductData,
LearnProductName,
Expand All @@ -191,4 +219,7 @@ export type {
ProductSlug,
ProductWithCurrentRootDocsPath,
RootDocsPath,
ProductNavData,
ProductNavPromo,
ProductSidePanel,
}

0 comments on commit 41d6f80

Please sign in to comment.