Skip to content

Commit

Permalink
Install page enhancement: Redirect to /install from any paths with /d…
Browse files Browse the repository at this point in the history
…ownloads (#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
  • Loading branch information
heatlikeheatwave committed Nov 8, 2023
1 parent d99b1de commit 393ea54
Show file tree
Hide file tree
Showing 32 changed files with 67 additions and 51 deletions.
16 changes: 16 additions & 0 deletions build-libs/redirects.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
12 changes: 6 additions & 6 deletions public/boundary-sitemap.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?><!--Generated by Screaming Frog SEO Spider 17.1-->
<!--
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
-->

<!--
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
-->

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://developer.hashicorp.com/boundary</loc>
Expand All @@ -18,7 +18,7 @@
<priority>0.9</priority>
</url>
<url>
<loc>https://developer.hashicorp.com/boundary/downloads</loc>
<loc>https://developer.hashicorp.com/boundary/install</loc>
<lastmod>2022-10-19</lastmod>
<changefreq>daily</changefreq>
<priority>0.9</priority>
Expand Down
2 changes: 1 addition & 1 deletion public/consul-sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<priority>0.9</priority>
</url>
<url>
<loc>https://developer.hashicorp.com/consul/downloads</loc>
<loc>https://developer.hashicorp.com/consul/install</loc>
<lastmod>2022-10-11</lastmod>
<changefreq>daily</changefreq>
<priority>0.9</priority>
Expand Down
12 changes: 6 additions & 6 deletions public/nomad-sitemap.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?><!--Generated by Screaming Frog SEO Spider 17.1-->
<!--
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
-->

<!--
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
-->

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://developer.hashicorp.com/nomad</loc>
Expand Down Expand Up @@ -120,7 +120,7 @@
<priority>0.9</priority>
</url>
<url>
<loc>https://developer.hashicorp.com/nomad/downloads</loc>
<loc>https://developer.hashicorp.com/nomad/install</loc>
<lastmod>2022-10-18</lastmod>
<changefreq>daily</changefreq>
<priority>0.9</priority>
Expand Down
12 changes: 6 additions & 6 deletions public/packer-sitemap.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?><!--Generated by Screaming Frog SEO Spider 17.1-->
<!--
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
-->

<!--
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
-->

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://developer.hashicorp.com/packer</loc>
Expand Down Expand Up @@ -42,7 +42,7 @@
<priority>0.9</priority>
</url>
<url>
<loc>https://developer.hashicorp.com/packer/downloads</loc>
<loc>https://developer.hashicorp.com/packer/install</loc>
<lastmod>2022-10-24</lastmod>
<changefreq>daily</changefreq>
<priority>0.9</priority>
Expand Down
12 changes: 6 additions & 6 deletions public/terraform-sitemap.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?><!--Generated by Screaming Frog SEO Spider 17.1-->
<!--
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
-->

<!--
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
-->

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://developer.hashicorp.com/terraform</loc>
Expand Down Expand Up @@ -60,7 +60,7 @@
<priority>0.9</priority>
</url>
<url>
<loc>https://developer.hashicorp.com/terraform/downloads</loc>
<loc>https://developer.hashicorp.com/terraform/install</loc>
<lastmod>2022-10-20</lastmod>
<changefreq>daily</changefreq>
<priority>0.9</priority>
Expand Down
14 changes: 7 additions & 7 deletions public/vagrant-sitemap.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?><!--Generated by Screaming Frog SEO Spider 17.1-->
<!--
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
-->

<!--
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
-->

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://developer.hashicorp.com/vagrant</loc>
Expand Down Expand Up @@ -60,7 +60,7 @@
<priority>0.9</priority>
</url>
<url>
<loc>https://developer.hashicorp.com/vagrant/downloads</loc>
<loc>https://developer.hashicorp.com/vagrant/install</loc>
<lastmod>2022-10-24</lastmod>
<changefreq>daily</changefreq>
<priority>0.9</priority>
Expand Down Expand Up @@ -564,7 +564,7 @@
<priority>0.8</priority>
</url>
<url>
<loc>https://developer.hashicorp.com/vagrant/downloads/vmware</loc>
<loc>https://developer.hashicorp.com/vagrant/install/vmware</loc>
<lastmod>2022-10-24</lastmod>
<changefreq>daily</changefreq>
<priority>0.8</priority>
Expand Down
2 changes: 1 addition & 1 deletion public/vault-sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
<priority>0.9</priority>
</url>
<url>
<loc>https://developer.hashicorp.com/vault/downloads</loc>
<loc>https://developer.hashicorp.com/vault/install</loc>
<lastmod>2022-10-18</lastmod>
<changefreq>daily</changefreq>
<priority>0.9</priority>
Expand Down
12 changes: 6 additions & 6 deletions public/waypoint-sitemap.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
-->

<!--
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
-->

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://developer.hashicorp.com/waypoint</loc>
Expand Down Expand Up @@ -144,7 +144,7 @@
<priority>0.9</priority>
</url>
<url>
<loc>https://developer.hashicorp.com/waypoint/downloads</loc>
<loc>https://developer.hashicorp.com/waypoint/install</loc>
<lastmod>2022-10-10</lastmod>
<changefreq>daily</changefreq>
<priority>0.9</priority>
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/e2e/seo.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe('getNavItems', () => {
Array [
Object {
"label": "Install",
"url": "/waypoint/downloads",
"url": "/waypoint/install",
},
Object {
"label": "Tutorials",
Expand Down Expand Up @@ -177,7 +177,7 @@ describe('getNavItems', () => {
Array [
Object {
"label": "Install",
"url": "/terraform/downloads",
"url": "/terraform/install",
},
Object {
"label": "Tutorials",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const generateInstallViewNavItems = (
: `Install ${product.name}`
const titleItem = {
title,
fullPath: `/${product.slug}/downloads`,
fullPath: `/${product.slug}/install`,
theme: product.slug,
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const generateProductLandingSidebarMenuItems = (
if (product.slug !== 'hcp') {
menuItems.push({
title: 'Install',
fullPath: `/${product.slug}/downloads`,
fullPath: `/${product.slug}/install`,
})
}

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ function VagrantDownloadsPage(props: ProductDownloadsViewProps) {
<CalloutCard
heading="VMware Utility"
headingSlug="vmware-utility"
body="From this page you can download the VMware utility, review lease information and much more. These tools are maintained by HashiCorp and the Vagrant Community."
ctas={[{ text: 'Download', url: '/vagrant/downloads/vmware' }]}
body="From this page you can install the VMware utility, review lease information and much more. These tools are maintained by HashiCorp and the Vagrant Community."
ctas={[{ text: 'Install', url: '/vagrant/install/vmware' }]}
/>
),
}}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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`
)
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/views/docs-view/utils/product-url-adjusters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
2 changes: 1 addition & 1 deletion src/views/product-downloads-view/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 [
Expand Down
2 changes: 1 addition & 1 deletion src/views/product-landing/helpers/get-icon-cards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function getIconCards(product: ProductData) {
iconCards.push({
icon: <IconDownload16 />,
text: 'Install',
url: `/${product.slug}/downloads`,
url: `/${product.slug}/install`,
})
}

Expand Down

1 comment on commit 393ea54

@vercel
Copy link

@vercel vercel bot commented on 393ea54 Nov 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.