Skip to content

Commit

Permalink
Revert changes to server.ts; make vmware a regular a tag
Browse files Browse the repository at this point in the history
  • Loading branch information
heatlikeheatwave committed Jun 21, 2024
1 parent cbbe59f commit 935aa5a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 22 deletions.
23 changes: 14 additions & 9 deletions src/pages/vagrant/install/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,20 @@ const VagrantDownloadsMerchandisingSlot = (): ReactElement => {
From this page you can download, review lease information and much more.
These tools are maintained by HashiCorp and the Vagrant community
</Text>
<ButtonLink
className={s.cta}
color="primary"
size="small"
href="/vagrant/install/vmware"
icon={<IconArrowRight16 />}
iconPosition="trailing"
text="Explore"
/>

<a className={s.cta} color="primary" href="/vagrant/install/vmware">
<>
<Text
asElement="span"
className={s.description}
size={200}
weight="regular"
>
Explore
</Text>
<IconArrowRight16 />
</>
</a>
</Card>
)
}
Expand Down
23 changes: 10 additions & 13 deletions src/views/product-downloads-view/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,19 @@ const generateGetStaticProps = (
* Note: could consider other content sources. For now, JSON.
* Asana task: https://app.asana.com/0/1100423001970639/1201631159784193/f
*/
const filePath = options.jsonFilePath?.length
? options.jsonFilePath
: `src/content/${product.slug}/install-landing.json`
let jsonFilePath = path.join(
process.cwd(),
`src/content/${product.slug}/install-landing.json`
)

let CONTENT
try {
if (fs.existsSync(filePath)) {
throw new Error(`File not found: ${filePath}`)
}
const jsonFilePath = path.join(process.cwd(), filePath)
const fileContent = fs.readFileSync(jsonFilePath, 'utf8')
CONTENT = JSON.parse(fileContent)
} catch (error) {
console.warn(error)
if (options.jsonFilePath) {
jsonFilePath = path.join(process.cwd(), options.jsonFilePath)
}

const CONTENT: RawProductDownloadsViewContent = JSON.parse(
fs.readFileSync(jsonFilePath, 'utf8')
)

const {
doesNotHavePackageManagers,
featuredCollectionsSlugs,
Expand Down

0 comments on commit 935aa5a

Please sign in to comment.