Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

enable content exclusion on cloud-docs #2392

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion pages/cloud-docs/[[...page]].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { getStaticGenerationFunctions } from '@hashicorp/react-docs-page/server'
import path from 'path'
import { rehypePlugins, remarkPlugins } from 'lib/remark-rehype-plugins'
import { remarkRewriteAssets } from 'lib/remark-rewrite-assets'
import { remarkTfeContentExclusion } from 'lib/remark-tfe-content-exclusion'

// Configure the docs path
const BASE_ROUTE = 'cloud-docs'
Expand Down Expand Up @@ -47,13 +48,14 @@ const { getStaticPaths, getStaticProps } = getStaticGenerationFunctions(
filepath = filepath.replace('preview/', '')
return `https://github.com/hashicorp/${SOURCE_REPO}/blob/${DEFAULT_BRANCH}/website/${filepath}`
},
remarkPlugins: (params) => [
remarkPlugins: (params, version) => [
...remarkPlugins,
remarkRewriteAssets({
product: SOURCE_REPO,
version: process.env.CURRENT_GIT_BRANCH,
getAssetPathParts: (nodeUrl) => ['website', nodeUrl],
}),
[remarkTfeContentExclusion, { version }],
],
rehypePlugins,
}
Expand Down