diff --git a/website/data/subnav.js b/website/data/subnav.js index be2d7179c..283a31b9a 100644 --- a/website/data/subnav.js +++ b/website/data/subnav.js @@ -9,13 +9,6 @@ export default [ url: '/docs', type: 'inbound', }, - { - text: 'Book', - url: - 'https://www.amazon.com/gp/product/1449335837/ref=as_li_qf_sp_asin_il_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1449335837&linkCode=as2&tag=vagrant-20', - type: 'outbound', - }, - { text: 'VMWare', url: '/vmware', diff --git a/website/data/version.js b/website/data/version.js index 0f40cd2a5..e464dc7be 100644 --- a/website/data/version.js +++ b/website/data/version.js @@ -1,2 +1,2 @@ export default '2.2.9' -export const VMWARE_UTILITY_VERSION = '1.0.7' +export const VMWARE_UTILITY_VERSION = '1.0.9' diff --git a/website/pages/vmware/downloads.html.erb b/website/pages/vmware/downloads.html.erb deleted file mode 100644 index 7956e5442..000000000 --- a/website/pages/vmware/downloads.html.erb +++ /dev/null @@ -1,60 +0,0 @@ ---- -layout: "downloads" -sidebar_current: "vmware" -page_title: "Vagrant VMware Utility Download" -description: |- - This page lists all the available downloads for the Vagrant VMware Utility. ---- - -

Download Vagrant VMware Utility

- -
-
-
-

- Below are the available downloads for the latest version of the Vagrant - VMware Utility (<%= vmware_utility_version %>). Please download the proper package - for your operating system and architecture. -

-

- You can find the - - SHA256 checksums for the Vagrant VMware Utility <%= vmware_utility_version %> - - online and you can - - verify the checksum's signature file - , - which has been signed using HashiCorp's GPG key. - You can also download older versions of - the Vagrant VMware utility from the releases service. -

-
-
- - <% Middleman::HashiCorp::Releases.fetch(vmware_utility_name, vmware_utility_version).each do |os, arches| %> - <% next if os == "web" %> -
-
-
<%= system_icon(os) %>
-
-

<%= pretty_os(os) %>

- -
-
-
-
- <% end %> - -
- -
-
diff --git a/website/pages/vmware/downloads/index.jsx b/website/pages/vmware/downloads/index.jsx new file mode 100644 index 000000000..f621fc64d --- /dev/null +++ b/website/pages/vmware/downloads/index.jsx @@ -0,0 +1,50 @@ +import s from './style.module.css' +import { VMWARE_UTILITY_VERSION } from '../../../data/version.js' +import ProductDownloader from '@hashicorp/react-product-downloader' +import Head from 'next/head' +import HashiHead from '@hashicorp/react-head' + +export default function DownloadsPage({ downloadData }) { + return ( +
+ + +
+ ) +} + +export async function getStaticProps() { + return fetch( + `https://releases.hashicorp.com/vagrant-vmware-utility/${VMWARE_UTILITY_VERSION}/index.json` + ) + .then((r) => r.json()) + .then((r) => { + // TODO: restructure product-downloader to run this logic internally + return r.builds.reduce((acc, build) => { + if (!acc[build.os]) acc[build.os] = {} + acc[build.os][build.arch] = build.url + return acc + }, {}) + }) + .then((r) => ({ props: { downloadData: r } })) + .catch(() => { + throw new Error( + `-------------------------------------------------------- + Unable to resolve version ${VMWARE_UTILITY_VERSION} on releases.hashicorp.com from link + . Usually this + means that the specified version has not yet been released. The downloads page + version can only be updated after the new version has been released, to ensure + that it works for all users. + ----------------------------------------------------------` + ) + }) +} diff --git a/website/pages/vmware/downloads/style.module.css b/website/pages/vmware/downloads/style.module.css new file mode 100644 index 000000000..893f14f5b --- /dev/null +++ b/website/pages/vmware/downloads/style.module.css @@ -0,0 +1,5 @@ +.root { + composes: g-grid-container from global; + margin-top: 72px; + margin-bottom: 72px; +} diff --git a/website/pages/vmware/index.jsx b/website/pages/vmware/index.jsx index 9f6539bac..01e6df296 100644 --- a/website/pages/vmware/index.jsx +++ b/website/pages/vmware/index.jsx @@ -1,10 +1,13 @@ import s from './style.module.css' import Button from '@hashicorp/react-button' import VMWarePurchaseForm from 'components/vmware-purchase-form' +import Head from 'next/head' +import HashiHead from '@hashicorp/react-head' export default function VmwareIndex() { return ( <> +