Skip to content

Commit f7bc468

Browse files
authored
Fix policy overview index (#519)
1 parent 3fec3e3 commit f7bc468

File tree

5 files changed

+15
-5
lines changed

5 files changed

+15
-5
lines changed

scripts/generate-policies.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ In addition to the built-in policies, Zuplo is [fully programmable](/docs/polici
351351

352352
await fs.mkdir(policyDir, { recursive: true });
353353
await fs.writeFile(
354-
path.join(policyDir, "index.mdx"),
354+
path.join(policyDir, "overview.mdx"),
355355
await prettier.format(policyIndex, { parser: "mdx" }),
356356
);
357357

sidebar.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ export const policies: SidebarEntry = [
389389
{
390390
type: "category",
391391
label: "Overview",
392-
items: ["policies/index", "articles/policies"],
392+
items: ["policies/overview", "articles/policies"],
393393
},
394394
{
395395
type: "category",

src/components.tsx

+5-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ export const mdxComponents = {
2626
/>
2727
),
2828
img: (props: any) => {
29+
let srcSet;
30+
2931
if (
32+
process.env.NODE_ENV === "production" &&
3033
props.src &&
3134
!props.srcSet &&
3235
!props.src.endsWith(".svg") &&
@@ -37,7 +40,7 @@ export const mdxComponents = {
3740
? new URL(props.src).pathname
3841
: props.src;
3942

40-
props.srcSet = [
43+
srcSet = [
4144
`https://cdn.zuplo.com/cdn-cgi/image/fit=contain,width=640,format=auto${path} 640w`,
4245
`https://cdn.zuplo.com/cdn-cgi/image/fit=contain,width=960,format=auto${path} 960w`,
4346
`https://cdn.zuplo.com/cdn-cgi/image/fit=contain,width=1280,format=auto${path} 1280w`,
@@ -48,7 +51,7 @@ export const mdxComponents = {
4851
}
4952
}
5053

51-
return <img {...props} />;
54+
return <img {...props} srcSet={srcSet} />;
5255
},
5356
PolicyOverview,
5457
EnterpriseFeature,

vercel.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,12 @@
460460
},
461461
{
462462
"source": "/docs/overview/policies{/}?",
463-
"destination": "/docs/policies/index",
463+
"destination": "/docs/policies/overview",
464+
"permanent": true
465+
},
466+
{
467+
"source": "/docs/policies/index{/}?",
468+
"destination": "/docs/policies/overview",
464469
"permanent": true
465470
},
466471
{

zudoku.config.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ const config: ZudokuConfig = {
3030
from: "/",
3131
to: "/articles/what-is-zuplo",
3232
},
33+
{ from: "/policies/index", to: "/policies/overview" },
34+
{ from: "/policies", to: "/policies/overview" },
3335
],
3436
theme: {
3537
dark: {

0 commit comments

Comments
 (0)