From c6ce421ad37cc4802f23039c6e219429fba0f4db Mon Sep 17 00:00:00 2001 From: Robert Main <50675045+rmainwork@users.noreply.github.com> Date: Fri, 30 Aug 2024 14:47:39 -0400 Subject: [PATCH] Remove "Edit on GitHub" link from terraform docs (#2540) * 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 --- src/views/docs-view/server.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/views/docs-view/server.ts b/src/views/docs-view/server.ts index 84424c41ed..effa868f41 100644 --- a/src/views/docs-view/server.ts +++ b/src/views/docs-view/server.ts @@ -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/.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 }