From 393ea5424e0af946ebd6ca7fdbe57e8519216399 Mon Sep 17 00:00:00 2001 From: Heat Hamilton <55773810+heatlikeheatwave@users.noreply.github.com> Date: Wed, 8 Nov 2023 17:26:52 -0500 Subject: [PATCH] Install page enhancement: Redirect to /install from any paths with /downloads (#2221) * Redirect to /install from any paths with /downloads * Update goto url in seo test * Updated the install page redirects to use regex * Updated sitemaps to use /install * Updated tests for /install redirects --- build-libs/redirects.js | 16 ++++++++++++++++ public/boundary-sitemap.xml | 12 ++++++------ public/consul-sitemap.xml | 2 +- public/nomad-sitemap.xml | 12 ++++++------ public/packer-sitemap.xml | 12 ++++++------ public/terraform-sitemap.xml | 12 ++++++------ public/vagrant-sitemap.xml | 14 +++++++------- public/vault-sitemap.xml | 2 +- public/waypoint-sitemap.xml | 12 ++++++------ src/__tests__/e2e/seo.spec.ts | 2 +- .../utils/__tests__/get-nav-items.test.ts | 4 ++-- .../product-page-content/utils/get-nav-items.ts | 2 +- .../helpers/generate-install-view-nav-items.ts | 2 +- .../generate-product-landing-nav-items.ts | 2 +- .../boundary/{downloads => install}/index.tsx | 0 .../consul-downloads.module.css | 0 .../consul/{downloads => install}/enterprise.tsx | 0 .../consul/{downloads => install}/index.tsx | 0 .../nomad/{downloads => install}/enterprise.tsx | 0 src/pages/nomad/{downloads => install}/index.tsx | 0 .../packer/{downloads => install}/index.tsx | 0 .../terraform/{downloads => install}/index.tsx | 0 .../vagrant/{downloads => install}/index.tsx | 4 ++-- .../{downloads => install}/vmware/index.tsx | 0 .../vault/{downloads => install}/enterprise.tsx | 0 src/pages/vault/{downloads => install}/index.tsx | 0 .../{downloads => install}/downloads.module.css | 0 .../waypoint/{downloads => install}/index.tsx | 0 .../utils/__tests__/rewrite-docs-url.test.ts | 2 +- .../docs-view/utils/product-url-adjusters.ts | 2 +- src/views/product-downloads-view/helpers.ts | 2 +- .../product-landing/helpers/get-icon-cards.tsx | 2 +- 32 files changed, 67 insertions(+), 51 deletions(-) rename src/pages/boundary/{downloads => install}/index.tsx (100%) rename src/pages/consul/{downloads => install}/consul-downloads.module.css (100%) rename src/pages/consul/{downloads => install}/enterprise.tsx (100%) rename src/pages/consul/{downloads => install}/index.tsx (100%) rename src/pages/nomad/{downloads => install}/enterprise.tsx (100%) rename src/pages/nomad/{downloads => install}/index.tsx (100%) rename src/pages/packer/{downloads => install}/index.tsx (100%) rename src/pages/terraform/{downloads => install}/index.tsx (100%) rename src/pages/vagrant/{downloads => install}/index.tsx (78%) rename src/pages/vagrant/{downloads => install}/vmware/index.tsx (100%) rename src/pages/vault/{downloads => install}/enterprise.tsx (100%) rename src/pages/vault/{downloads => install}/index.tsx (100%) rename src/pages/waypoint/{downloads => install}/downloads.module.css (100%) rename src/pages/waypoint/{downloads => install}/index.tsx (100%) diff --git a/build-libs/redirects.js b/build-libs/redirects.js index cd7e317ff6..fed45ce2b6 100644 --- a/build-libs/redirects.js +++ b/build-libs/redirects.js @@ -309,6 +309,22 @@ async function buildDevPortalRedirects() { destination: '/waypoint/integrations/hashicorp/:slug', permanent: true, }, + { + source: + '/:path(boundary|consul|nomad|packer|terraform|vagrant|vault|waypoint)/downloads', + destination: '/:path/install', + permanent: true, + }, + { + source: '/:path(consul|nomad|vault)/downloads/enterprise', + destination: '/:path/install/enterprise', + permanent: true, + }, + { + source: '/vagrant/downloads/vmware', + destination: '/vagrant/install/vmware', + permanent: true, + }, /** * Redirect for Integration Component rework. * Further details in the file this is imported from. diff --git a/public/boundary-sitemap.xml b/public/boundary-sitemap.xml index 939f0d05be..cacb23533b 100644 --- a/public/boundary-sitemap.xml +++ b/public/boundary-sitemap.xml @@ -1,9 +1,9 @@ - - + + https://developer.hashicorp.com/boundary @@ -18,7 +18,7 @@ 0.9 - https://developer.hashicorp.com/boundary/downloads + https://developer.hashicorp.com/boundary/install 2022-10-19 daily 0.9 diff --git a/public/consul-sitemap.xml b/public/consul-sitemap.xml index fed54054e0..9d6f271bc7 100644 --- a/public/consul-sitemap.xml +++ b/public/consul-sitemap.xml @@ -48,7 +48,7 @@ 0.9 - https://developer.hashicorp.com/consul/downloads + https://developer.hashicorp.com/consul/install 2022-10-11 daily 0.9 diff --git a/public/nomad-sitemap.xml b/public/nomad-sitemap.xml index 3eea3cd312..8b1a4af00f 100644 --- a/public/nomad-sitemap.xml +++ b/public/nomad-sitemap.xml @@ -1,9 +1,9 @@ - - + + https://developer.hashicorp.com/nomad @@ -120,7 +120,7 @@ 0.9 - https://developer.hashicorp.com/nomad/downloads + https://developer.hashicorp.com/nomad/install 2022-10-18 daily 0.9 diff --git a/public/packer-sitemap.xml b/public/packer-sitemap.xml index d29a121e38..12299e3903 100644 --- a/public/packer-sitemap.xml +++ b/public/packer-sitemap.xml @@ -1,9 +1,9 @@ - - + + https://developer.hashicorp.com/packer @@ -42,7 +42,7 @@ 0.9 - https://developer.hashicorp.com/packer/downloads + https://developer.hashicorp.com/packer/install 2022-10-24 daily 0.9 diff --git a/public/terraform-sitemap.xml b/public/terraform-sitemap.xml index 4c2f0a86aa..8ad472a066 100644 --- a/public/terraform-sitemap.xml +++ b/public/terraform-sitemap.xml @@ -1,9 +1,9 @@ - - + + https://developer.hashicorp.com/terraform @@ -60,7 +60,7 @@ 0.9 - https://developer.hashicorp.com/terraform/downloads + https://developer.hashicorp.com/terraform/install 2022-10-20 daily 0.9 diff --git a/public/vagrant-sitemap.xml b/public/vagrant-sitemap.xml index 848322c6aa..2def91ac02 100644 --- a/public/vagrant-sitemap.xml +++ b/public/vagrant-sitemap.xml @@ -1,9 +1,9 @@ - - + + https://developer.hashicorp.com/vagrant @@ -60,7 +60,7 @@ 0.9 - https://developer.hashicorp.com/vagrant/downloads + https://developer.hashicorp.com/vagrant/install 2022-10-24 daily 0.9 @@ -564,7 +564,7 @@ 0.8 - https://developer.hashicorp.com/vagrant/downloads/vmware + https://developer.hashicorp.com/vagrant/install/vmware 2022-10-24 daily 0.8 diff --git a/public/vault-sitemap.xml b/public/vault-sitemap.xml index 54c91d4dd2..fd1b2e8864 100644 --- a/public/vault-sitemap.xml +++ b/public/vault-sitemap.xml @@ -96,7 +96,7 @@ 0.9 - https://developer.hashicorp.com/vault/downloads + https://developer.hashicorp.com/vault/install 2022-10-18 daily 0.9 diff --git a/public/waypoint-sitemap.xml b/public/waypoint-sitemap.xml index 640be57139..a009ffd1f0 100644 --- a/public/waypoint-sitemap.xml +++ b/public/waypoint-sitemap.xml @@ -1,9 +1,9 @@ - - + + https://developer.hashicorp.com/waypoint @@ -144,7 +144,7 @@ 0.9 - https://developer.hashicorp.com/waypoint/downloads + https://developer.hashicorp.com/waypoint/install 2022-10-10 daily 0.9 diff --git a/src/__tests__/e2e/seo.spec.ts b/src/__tests__/e2e/seo.spec.ts index 0b142bcf03..fd2c8c1142 100644 --- a/src/__tests__/e2e/seo.spec.ts +++ b/src/__tests__/e2e/seo.spec.ts @@ -76,7 +76,7 @@ test('install page should render the expected metadata', async ({ context, baseURL, }) => { - await page.goto('/waypoint/downloads') + await page.goto('/waypoint/install') await expect(page).toHaveTitle( `Install | Waypoint | ${__config.dev_dot.meta.title}` ) diff --git a/src/components/navigation-header/components/product-page-content/utils/__tests__/get-nav-items.test.ts b/src/components/navigation-header/components/product-page-content/utils/__tests__/get-nav-items.test.ts index 7948286436..4ced96a9dd 100644 --- a/src/components/navigation-header/components/product-page-content/utils/__tests__/get-nav-items.test.ts +++ b/src/components/navigation-header/components/product-page-content/utils/__tests__/get-nav-items.test.ts @@ -29,7 +29,7 @@ describe('getNavItems', () => { Array [ Object { "label": "Install", - "url": "/waypoint/downloads", + "url": "/waypoint/install", }, Object { "label": "Tutorials", @@ -177,7 +177,7 @@ describe('getNavItems', () => { Array [ Object { "label": "Install", - "url": "/terraform/downloads", + "url": "/terraform/install", }, Object { "label": "Tutorials", diff --git a/src/components/navigation-header/components/product-page-content/utils/get-nav-items.ts b/src/components/navigation-header/components/product-page-content/utils/get-nav-items.ts index fea4dfe256..cadd8ef480 100644 --- a/src/components/navigation-header/components/product-page-content/utils/get-nav-items.ts +++ b/src/components/navigation-header/components/product-page-content/utils/get-nav-items.ts @@ -99,7 +99,7 @@ export function getNavItems(currentProduct: ProductData): NavItem[] { if (currentProduct.slug !== 'hcp') { items.push({ label: 'Install', - url: `/${currentProduct.slug}/downloads`, + url: `/${currentProduct.slug}/install`, }) } diff --git a/src/components/sidebar/helpers/generate-install-view-nav-items.ts b/src/components/sidebar/helpers/generate-install-view-nav-items.ts index 6421988b55..9c6813d3bc 100644 --- a/src/components/sidebar/helpers/generate-install-view-nav-items.ts +++ b/src/components/sidebar/helpers/generate-install-view-nav-items.ts @@ -39,7 +39,7 @@ export const generateInstallViewNavItems = ( : `Install ${product.name}` const titleItem = { title, - fullPath: `/${product.slug}/downloads`, + fullPath: `/${product.slug}/install`, theme: product.slug, } diff --git a/src/components/sidebar/helpers/generate-product-landing-nav-items.ts b/src/components/sidebar/helpers/generate-product-landing-nav-items.ts index bc929e1792..60ff556047 100644 --- a/src/components/sidebar/helpers/generate-product-landing-nav-items.ts +++ b/src/components/sidebar/helpers/generate-product-landing-nav-items.ts @@ -48,7 +48,7 @@ export const generateProductLandingSidebarMenuItems = ( if (product.slug !== 'hcp') { menuItems.push({ title: 'Install', - fullPath: `/${product.slug}/downloads`, + fullPath: `/${product.slug}/install`, }) } diff --git a/src/pages/boundary/downloads/index.tsx b/src/pages/boundary/install/index.tsx similarity index 100% rename from src/pages/boundary/downloads/index.tsx rename to src/pages/boundary/install/index.tsx diff --git a/src/pages/consul/downloads/consul-downloads.module.css b/src/pages/consul/install/consul-downloads.module.css similarity index 100% rename from src/pages/consul/downloads/consul-downloads.module.css rename to src/pages/consul/install/consul-downloads.module.css diff --git a/src/pages/consul/downloads/enterprise.tsx b/src/pages/consul/install/enterprise.tsx similarity index 100% rename from src/pages/consul/downloads/enterprise.tsx rename to src/pages/consul/install/enterprise.tsx diff --git a/src/pages/consul/downloads/index.tsx b/src/pages/consul/install/index.tsx similarity index 100% rename from src/pages/consul/downloads/index.tsx rename to src/pages/consul/install/index.tsx diff --git a/src/pages/nomad/downloads/enterprise.tsx b/src/pages/nomad/install/enterprise.tsx similarity index 100% rename from src/pages/nomad/downloads/enterprise.tsx rename to src/pages/nomad/install/enterprise.tsx diff --git a/src/pages/nomad/downloads/index.tsx b/src/pages/nomad/install/index.tsx similarity index 100% rename from src/pages/nomad/downloads/index.tsx rename to src/pages/nomad/install/index.tsx diff --git a/src/pages/packer/downloads/index.tsx b/src/pages/packer/install/index.tsx similarity index 100% rename from src/pages/packer/downloads/index.tsx rename to src/pages/packer/install/index.tsx diff --git a/src/pages/terraform/downloads/index.tsx b/src/pages/terraform/install/index.tsx similarity index 100% rename from src/pages/terraform/downloads/index.tsx rename to src/pages/terraform/install/index.tsx diff --git a/src/pages/vagrant/downloads/index.tsx b/src/pages/vagrant/install/index.tsx similarity index 78% rename from src/pages/vagrant/downloads/index.tsx rename to src/pages/vagrant/install/index.tsx index c6c0f2ca6f..a138e8fd69 100644 --- a/src/pages/vagrant/downloads/index.tsx +++ b/src/pages/vagrant/install/index.tsx @@ -20,8 +20,8 @@ function VagrantDownloadsPage(props: ProductDownloadsViewProps) { ), }} diff --git a/src/pages/vagrant/downloads/vmware/index.tsx b/src/pages/vagrant/install/vmware/index.tsx similarity index 100% rename from src/pages/vagrant/downloads/vmware/index.tsx rename to src/pages/vagrant/install/vmware/index.tsx diff --git a/src/pages/vault/downloads/enterprise.tsx b/src/pages/vault/install/enterprise.tsx similarity index 100% rename from src/pages/vault/downloads/enterprise.tsx rename to src/pages/vault/install/enterprise.tsx diff --git a/src/pages/vault/downloads/index.tsx b/src/pages/vault/install/index.tsx similarity index 100% rename from src/pages/vault/downloads/index.tsx rename to src/pages/vault/install/index.tsx diff --git a/src/pages/waypoint/downloads/downloads.module.css b/src/pages/waypoint/install/downloads.module.css similarity index 100% rename from src/pages/waypoint/downloads/downloads.module.css rename to src/pages/waypoint/install/downloads.module.css diff --git a/src/pages/waypoint/downloads/index.tsx b/src/pages/waypoint/install/index.tsx similarity index 100% rename from src/pages/waypoint/downloads/index.tsx rename to src/pages/waypoint/install/index.tsx diff --git a/src/views/docs-view/utils/__tests__/rewrite-docs-url.test.ts b/src/views/docs-view/utils/__tests__/rewrite-docs-url.test.ts index f00719df31..2db4085c5a 100644 --- a/src/views/docs-view/utils/__tests__/rewrite-docs-url.test.ts +++ b/src/views/docs-view/utils/__tests__/rewrite-docs-url.test.ts @@ -24,7 +24,7 @@ describe('rewriteDocsUrl', () => { // special case for vagrant vmware utility downloads page if (productSlug === 'vagrant') { expect(rewriteDocsUrl('/vmware/downloads', productData)).toBe( - `/${productSlug}/downloads/vmware` + `/${productSlug}/install/vmware` ) } } diff --git a/src/views/docs-view/utils/product-url-adjusters.ts b/src/views/docs-view/utils/product-url-adjusters.ts index 4c41149706..ea19e6ff86 100644 --- a/src/views/docs-view/utils/product-url-adjusters.ts +++ b/src/views/docs-view/utils/product-url-adjusters.ts @@ -152,7 +152,7 @@ export function rewriteDocsUrl( currentProduct.slug === 'vagrant' && inputUrl.startsWith('/vmware/downloads') ) { - return `/${currentProduct.slug}/downloads/vmware` + return `/${currentProduct.slug}/install/vmware` } return `/${currentProduct.slug}${inputUrl}` } else if (!isProductPath.test(inputUrl) && !isTutorialsPath.test(inputUrl)) { diff --git a/src/views/product-downloads-view/helpers.ts b/src/views/product-downloads-view/helpers.ts index 7346716a95..8278d71557 100644 --- a/src/views/product-downloads-view/helpers.ts +++ b/src/views/product-downloads-view/helpers.ts @@ -154,7 +154,7 @@ export const initializeBreadcrumbLinks = ( pathname: string ): BreadcrumbLink[] => { const nonEnterpriseTitle = - pathname === '/vagrant/downloads/vmware' + pathname === '/vagrant/install/vmware' ? `Install VMware Utility` : `Install` return [ diff --git a/src/views/product-landing/helpers/get-icon-cards.tsx b/src/views/product-landing/helpers/get-icon-cards.tsx index 551b06fbae..22c1b60d4c 100644 --- a/src/views/product-landing/helpers/get-icon-cards.tsx +++ b/src/views/product-landing/helpers/get-icon-cards.tsx @@ -22,7 +22,7 @@ export function getIconCards(product: ProductData) { iconCards.push({ icon: , text: 'Install', - url: `/${product.slug}/downloads`, + url: `/${product.slug}/install`, }) }