open-vault/website/pages/downloads/index.jsx
Meggie 259aa74728
docs: add release notes (#9540)
* Create nav for release notes

* Update 1.5.0.mdx

Initial release notes

* Update 1.5.0.mdx

Minor edits

* Update 1.5.0.mdx

Made a small grammatical edit

* Update 1.5.0.mdx

Changed a period to a colon

* Update 1.5.0.mdx

Some minor formatting changes

* Update 1.5.0.mdx

Changes to the Splunk app description

* Update 1.5.0.mdx

Small change to the vault monitor command description

* Update 1.5.0.mdx

Small change to the description of the vault monitor command

* Update 1.5.0.mdx

Added link to the Splunk app for Monitoring Vault

* Updating version

* Capitalization consistency

Co-authored-by: Andy Manoske <andy@hashicorp.com>
Co-authored-by: Darshana Sivakumar <darshana10@gmail.com>
2020-07-21 12:23:03 -04:00

40 lines
1.5 KiB
JavaScript

import fetch from 'isomorphic-unfetch'
import { VERSION, CHANGELOG_URL } 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 }) {
const changelogUrl = CHANGELOG_URL.length
? CHANGELOG_URL
: `https://github.com/hashicorp/vault/blob/v${VERSION}/CHANGELOG.md`
return (
<div id="p-downloads" className="g-container">
<HashiHead is={Head} title="Downloads | Vault by Hashicorp" />
<ProductDownloader
product="Vault"
version={VERSION}
releaseData={releaseData}
changelog={changelogUrl}
/>
</div>
)
}
export async function getStaticProps() {
return fetch(`https://releases.hashicorp.com/vault/${VERSION}/index.json`)
.then((r) => r.json())
.then((releaseData) => ({ props: { releaseData } }))
.catch(() => {
throw new Error(
`--------------------------------------------------------
Unable to resolve version ${VERSION} on releases.hashicorp.com from link
<https://releases.hashicorp.com/vault/${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.
----------------------------------------------------------`
)
})
}