Skip to content

Commit

Permalink
Remove "Edit on GitHub" link from terraform docs (#2540)
Browse files Browse the repository at this point in the history
* Rewrite boolean expressions as array.includes

Rewriting multiple boolean expressions as a single Array.includes()
expression allows additional slugs to be compared (simply by adding)
them to the array with relatively little additional complexity

* Add terraform to list of public content repos

This has the effect of removing the "Edit this page on GitHub" link at
the bottom of the terraform docs page. This was flagged up by a user who
tried to click the link and got a 404 because that GitHub repo is not
public
  • Loading branch information
rmainwork committed Aug 30, 2024
1 parent 55e5a6d commit c6ce421
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/views/docs-view/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -418,9 +418,9 @@ export function getStaticGenerationFunctions<
* Note: If we need more granularity here, we could change this to be
* part of `rootDocsPath` configuration in `src/data/<product>.json`.
*/
const isHcp = product.slug == 'hcp'
const isSentinel = product.slug == 'sentinel'
const isPublicContentRepo = !isHcp && !isSentinel
const isPublicContentRepo = !['hcp', 'sentinel', 'terraform'].includes(
product.slug
)
if (isPublicContentRepo) {
layoutProps.githubFileUrl = githubFileUrl
}
Expand Down

0 comments on commit c6ce421

Please sign in to comment.