Skip to content
Merged
Show file tree
Hide file tree
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
16 changes: 2 additions & 14 deletions src/components/Render.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,14 @@ type Props = z.infer<typeof props>;

const props = z.object({
file: z.string(),
product: z.string().optional(),
product: z.string(),
params: z.record(z.string(), z.any()).optional(),
});

let { file, product, params } = props.parse(Astro.props);

if (!product) {
const fromSlug = Astro.params.slug?.split("/")[0];

if (!fromSlug) {
throw new Error(
`[Render] Unable to infer which folder ${file} is in, please provide a "product" input with your "file" input.`,
);
}

product = fromSlug;
}

const id = `${product}/${file}`;
const partial = await getEntry("partials", id);
let partial = await getEntry("partials", id);

if (!partial) {
throw new Error(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ description: Learn how to configure your Enterprise zone with Webflow.

import { Render } from "~/components";

<Render file="provider-guide-intro" params={{ providerName: "Webflow" }} />
<Render
file="provider-guide-intro"
params={{ providerName: "Webflow" }}
product="cloudflare-for-platforms"
/>

## Benefits

Expand Down Expand Up @@ -38,7 +42,11 @@ To enable O2O on your account, [create](/dns/manage-dns-records/how-to/create-dn

## Additional support

<Render file="provider-guide-help" params={{ providerName: "Webflow" }} />
<Render
file="provider-guide-help"
params={{ providerName: "Webflow" }}
product="cloudflare-for-platforms"
/>

### DNS CAA records

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { Render } from "~/components";

<Render
file="casb/microsoft/integrations/sharepoint"
product="cloudflare-one"
params={{
integrationName: "SharePoint",
environmentName: "Microsoft 365 account",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -601,11 +601,11 @@ The HTTP response status code received by the traffic.

### Source Continent

The continent of the user making the request. <Render file="gateway/selectors/source-continent" params={{ one: "http.src_ip" }} />
The continent of the user making the request. <Render file="gateway/selectors/source-continent" product="cloudflare-one" params={{ one: "http.src_ip" }} />

### Source Country

The country of the user making the request. <Render file="gateway/selectors/source-country" params={{ one: "http.src_ip" }} />
The country of the user making the request. <Render file="gateway/selectors/source-country" product="cloudflare-one" params={{ one: "http.src_ip" }} />

### Source Internal IP

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,11 +355,11 @@ By default, this selector only applies to HTTPS traffic on port `443`. To inspec

### Source Continent

The continent of the user making the request. <Render file="gateway/selectors/source-continent" params={{ one: "net.src" }} />
The continent of the user making the request. <Render file="gateway/selectors/source-continent" product="cloudflare-one" params={{ one: "net.src" }} />

### Source Country

The country of the user making the request. <Render file="gateway/selectors/source-country" params={{ one: "net.src" }} />
The country of the user making the request. <Render file="gateway/selectors/source-country" product="cloudflare-one" params={{ one: "net.src" }} />

### Source Internal IP

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ This page lists the available Managed Transforms. They can modify HTTP request h

<Render
file="snippets-alternative"
product="rules"
params={{ suffix: "and customized header modifications" }}
/>

Expand Down
19 changes: 2 additions & 17 deletions src/content/docs/style-guide/components/render.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,9 @@ import { Render } from "~/components";

This should be the name of the partial, without the containing directory or file extension. For example, `/partials/style-guide/hello.mdx` would be `file="hello"`.

- `product` <Type text="string" /> <MetaInfo text="optional" />
- `product` <Type text="string" />

By default, it will look for partials in the same product folder as the current page. You can use this to specify a different product.

:::caution

When using the `Render` component inside partials, the original `product` is lost.

For example, if there are three files:
1. `docs/fundamentals/index.mdx`
2. `partials/dns/thing.mdx`
3. `partials/dns/thing2.mdx`

`docs/fundamentals/index.mdx` uses `<Render file="thing" product="dns" />`

`partials/dns/thing.mdx` must use `<Render file="thing2" product="dns" />` as `product` cannot be inferred.

:::
This should be the folder within `src/partials`.

- `params` <Type text="object" /> <MetaInfo text="optional" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Render } from "~/components";

<Render
file="casb/integration-description"
product="cloudflare-one"
params={{
integrationName: props.integrationName,
integrationAccountType: props.environmentName,
Expand All @@ -23,6 +24,7 @@ import { Render } from "~/components";

<Render
file="casb/integration-perms"
product="cloudflare-one"
params={{
parentIntegration: "Google Workspace",
parentSlug: "google-workspace",
Expand All @@ -33,6 +35,7 @@ import { Render } from "~/components";

<Render
file="casb/security-findings"
product="cloudflare-one"
params={{
integrationName: props.integrationName,
slugRelativePath: props.slugifiedName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Render } from "~/components";

<Render
file="casb/integration-description"
product="cloudflare-one"
params={{
integrationName: props.integrationName,
integrationAccountType: props.environmentName,
Expand All @@ -23,6 +24,7 @@ import { Render } from "~/components";

<Render
file="casb/integration-perms"
product="cloudflare-one"
params={{
parentIntegration: "Google Workspace",
parentSlug: "google-workspace",
Expand All @@ -33,6 +35,7 @@ import { Render } from "~/components";

<Render
file="casb/security-findings"
product="cloudflare-one"
params={{
integrationName: props.integrationName,
slugRelativePath: props.slugifiedName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Render } from "~/components";

<Render
file="casb/integration-description"
product="cloudflare-one"
params={{
integrationName: props.integrationName,
integrationAccountType: props.environmentName,
Expand All @@ -23,6 +24,7 @@ import { Render } from "~/components";

<Render
file="casb/integration-perms"
product="cloudflare-one"
params={{
parentIntegration: "Google Workspace",
parentSlug: "google-workspace",
Expand All @@ -33,6 +35,7 @@ import { Render } from "~/components";

<Render
file="casb/security-findings"
product="cloudflare-one"
params={{
integrationName: props.integrationName,
slugRelativePath: props.slugifiedName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Render } from "~/components";

<Render
file="casb/integration-description"
product="cloudflare-one"
params={{
integrationName: props.integrationName,
integrationAccountType: props.environmentName,
Expand All @@ -23,6 +24,7 @@ import { Render } from "~/components";

<Render
file="casb/integration-perms"
product="cloudflare-one"
params={{
parentIntegration: "Google Workspace",
parentSlug: "google-workspace",
Expand All @@ -33,6 +35,7 @@ import { Render } from "~/components";

<Render
file="casb/security-findings"
product="cloudflare-one"
params={{
integrationName: props.integrationName,
slugRelativePath: props.slugifiedName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { GlossaryTooltip, Render } from "~/components";

<Render
file="casb/integration-description"
product="cloudflare-one"
params={{
integrationName: props.integrationName,
integrationAccountType: props.environmentName,
Expand All @@ -23,13 +24,15 @@ import { GlossaryTooltip, Render } from "~/components";

<Render
file="casb/integration-perms"
product="cloudflare-one"
params={{ parentIntegration: "Microsoft 365", parentSlug: "microsoft-365" }}
/>

## Security findings

<Render
file="casb/security-findings"
product="cloudflare-one"
params={{
integrationName: props.integrationName,
slugRelativePath: props.slugifiedName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Render } from "~/components";

<Render
file="casb/integration-description"
product="cloudflare-one"
params={{
integrationName: props.integrationName,
integrationAccountType: props.environmentName,
Expand All @@ -23,13 +24,15 @@ import { Render } from "~/components";

<Render
file="casb/integration-perms"
product="cloudflare-one"
params={{ parentIntegration: "Microsoft 365", parentSlug: "microsoft-365" }}
/>

## Security findings

<Render
file="casb/security-findings"
product="cloudflare-one"
params={{
integrationName: props.integrationName,
slugRelativePath: props.slugifiedName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Render } from "~/components";

<Render
file="casb/integration-description"
product="cloudflare-one"
params={{
integrationName: props.integrationName,
integrationAccountType: props.environmentName,
Expand All @@ -23,13 +24,15 @@ import { Render } from "~/components";

<Render
file="casb/integration-perms"
product="cloudflare-one"
params={{ parentIntegration: "Microsoft 365", parentSlug: "microsoft-365" }}
/>

## Security findings

<Render
file="casb/security-findings"
product="cloudflare-one"
params={{
integrationName: props.integrationName,
slugRelativePath: props.slugifiedName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Render } from "~/components";

<Render
file="casb/integration-description"
product="cloudflare-one"
params={{
integrationName: props.integrationName,
integrationAccountType: props.environmentName,
Expand All @@ -23,13 +24,15 @@ import { Render } from "~/components";

<Render
file="casb/integration-perms"
product="cloudflare-one"
params={{ parentIntegration: "Microsoft 365", parentSlug: "microsoft-365" }}
/>

## Security findings

<Render
file="casb/security-findings"
product="cloudflare-one"
params={{
integrationName: props.integrationName,
slugRelativePath: props.slugifiedName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ import { Render } from "~/components";

<Render
file="casb/integration-description"
params={{ integrationName: props.integrationName, integrationAccountType: props.environmentName }}
product="cloudflare-one"
params={{
integrationName: props.integrationName,
integrationAccountType: props.environmentName,
}}
/>

## Integration prerequisites
Expand All @@ -34,7 +38,11 @@ These permissions follow the principle of least privilege to ensure that only th

<Render
file="casb/security-findings"
params={{ integrationName: props.integrationName, slugRelativePath: props.slugifiedName }}
product="cloudflare-one"
params={{
integrationName: props.integrationName,
slugRelativePath: props.slugifiedName,
}}
/>

### File sharing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Render } from "~/components";

<Render
file="casb/integration-description"
product="cloudflare-one"
params={{
integrationName: props.integrationName,
integrationAccountType: props.environmentName,
Expand All @@ -32,6 +33,7 @@ These permissions follow the principle of least privilege to ensure that only th

<Render
file="casb/security-findings"
product="cloudflare-one"
params={{
integrationName: props.integrationName,
slugRelativePath: props.slugifiedName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ Use this selector to match against a domain and all subdomains. For example, you

<Render
file="gateway/selectors/non-latin-characters"
product="cloudflare-one"
params={{ inputType: "domain" }}
/>
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Use this selector to match against only the hostname specified. For example, you

<Render
file="gateway/selectors/non-latin-characters"
product="cloudflare-one"
params={{ inputType: "hostname" }}
/>

Expand Down
Loading