open-nomad/website/pages/downloads/index.jsx
Michael Schurter 031e716554 docs: v1.0.0-beta2 released!
Calling it "Beta" even though it's "beta2" since "beta1" was never
published.
2020-10-27 09:24:09 -07:00

41 lines
1.4 KiB
JavaScript

import 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({ releaseData }) {
return (
<div id="p-downloads" className="g-container">
<HashiHead is={Head} title="Downloads | Nomad by HashiCorp" />
<ProductDownloader
product="Nomad"
version={VERSION}
releaseData={releaseData}
community="/resources"
prerelease={{
type: 'Beta',
name: 'v1.0.0',
version: '1.0.0-beta2'
}}
/>
</div>
)
}
export async function getStaticProps() {
return fetch(`https://releases.hashicorp.com/nomad/${VERSION}/index.json`)
.then((res) => res.json())
.then((releaseData) => ({ props: { releaseData } }))
.catch(() => {
throw new Error(
`--------------------------------------------------------
Unable to resolve version ${VERSION} on releases.hashicorp.com from link
<https://releases.hashicorp.com/nomad/${VERSION}/index.json>. 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.
----------------------------------------------------------`
)
})
}