@vercel/geistdocs 1.16.0 → 1.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/icons/icon-api.d.ts +5 -0
- package/dist/assets/icons/icon-api.d.ts.map +1 -0
- package/dist/assets/icons/icon-api.js +4 -0
- package/dist/assets/icons/index.d.ts +1 -0
- package/dist/assets/icons/index.d.ts.map +1 -1
- package/dist/assets/icons/index.js +1 -0
- package/dist/assets/logos/logo-icon-vercel.js +1 -1
- package/dist/assets/logos/logo-vercel-oss.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/footer.js +1 -1
- package/dist/internal/navbar/navbar-logo.d.ts.map +1 -1
- package/dist/internal/navbar/navbar-logo.js +1 -5
- package/dist/internal/page-actions-client.d.ts.map +1 -1
- package/dist/internal/page-actions-client.js +34 -10
- package/dist/internal/sidebar-tree.d.ts +1 -0
- package/dist/internal/sidebar-tree.d.ts.map +1 -1
- package/dist/internal/sidebar-tree.js +9 -0
- package/dist/internal/sidebar.d.ts.map +1 -1
- package/dist/internal/sidebar.js +2 -2
- package/dist/proxy.d.ts.map +1 -1
- package/dist/proxy.js +14 -3
- package/dist/versions.d.ts.map +1 -1
- package/dist/versions.js +1 -2
- package/docs/agents.md +1 -1
- package/docs/llms.txt +25 -2
- package/docs/manifest.json +1 -1
- package/docs/pages/guides/nested-navigation.md +23 -0
- package/docs/pages/syntax.md +1 -1
- package/package.json +10 -2
- package/template/content/docs/guides/nested-navigation.mdx +23 -0
- package/template/content/docs/syntax.mdx +1 -1
- package/template/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-api.d.ts","sourceRoot":"","sources":["../../../src/assets/icons/icon-api.tsx"],"names":[],"mappings":"AAAA,wBAAgB,OAAO,CAAC,EACtB,IAAS,EACT,SAAS,GACV,EAAE;IACD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,2CAoBA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
export function IconApi({ size = 16, className, }) {
|
|
3
|
+
return (_jsx("svg", { "aria-hidden": "true", className: className, fill: "none", height: size, role: "img", viewBox: "0 0 16 16", width: size, xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { clipRule: "evenodd", d: "M0.75 1H0V1.75V13.25V14H0.75H5.5V12.5H1.5V2.5H5C6.24264 2.5 7.25 3.50736 7.25 4.75V6.5H8.75V4.75C8.75 3.50736 9.75736 2.5 11 2.5H14.5V6.5H16V1.75V1H15.25H11C9.7733 1 8.68417 1.58901 8 2.49963C7.31583 1.58901 6.2267 1 5 1H0.75ZM11.0915 10.2175C11.4564 10.0309 11.7944 9.70265 11.9642 9.25H12.0358C12.2056 9.70265 12.5436 10.0309 12.9085 10.2175C12.9698 10.2488 13.0294 10.2833 13.0871 10.3208C13.4317 10.5446 13.886 10.6736 14.3637 10.5941L14.3994 10.6559C14.0923 11.0289 13.9765 11.4857 13.9973 11.8955C13.9991 11.93 14 11.9649 14 12C14 12.0351 13.9991 12.07 13.9973 12.1044C13.9765 12.5143 14.0923 12.9711 14.3994 13.3441L14.3637 13.4059C13.886 13.3264 13.4317 13.4554 13.0871 13.6792C13.0294 13.7167 12.9698 13.7512 12.9085 13.7825C12.5436 13.9691 12.2056 14.2973 12.0358 14.75H11.9642C11.7944 14.2973 11.4564 13.9691 11.0915 13.7825C11.0302 13.7512 10.9706 13.7167 10.9129 13.6792C10.5683 13.4554 10.114 13.3264 9.63627 13.4059L9.60059 13.3441C9.90769 12.9711 10.0235 12.5144 10.0027 12.1045C10.0009 12.07 10 12.0351 10 12C10 11.9649 10.0009 11.93 10.0027 11.8955C10.0235 11.4856 9.9077 11.0289 9.60061 10.6559L9.63629 10.5941C10.114 10.6736 10.5683 10.5446 10.9129 10.3208C10.9706 10.2833 11.0302 10.2488 11.0915 10.2175ZM15.4037 11.4079L15.9641 10.866L14.9641 9.13398L14.215 9.34827C14.0629 9.39177 13.9006 9.35863 13.7679 9.27247C13.6743 9.21169 13.5774 9.15559 13.4775 9.1045C13.3369 9.03257 13.2272 8.90865 13.1888 8.75537L13 8H11L10.8112 8.75537C10.7728 8.90865 10.6631 9.03257 10.5225 9.1045C10.4226 9.15558 10.3257 9.21168 10.2321 9.27247C10.0994 9.35862 9.93709 9.39176 9.78502 9.34826L9.03591 9.13397L8.03591 10.866L8.5963 11.4079C8.70977 11.5176 8.7623 11.6743 8.75427 11.8319C8.75143 11.8876 8.75 11.9436 8.75 12C8.75 12.0564 8.75143 12.1124 8.75427 12.168C8.7623 12.3257 8.70977 12.4824 8.5963 12.5921L8.03589 13.134L9.03589 14.866L9.78501 14.6517C9.93708 14.6082 10.0994 14.6414 10.2321 14.7275C10.3257 14.7883 10.4226 14.8444 10.5225 14.8955C10.6631 14.9674 10.7728 15.0913 10.8112 15.2446L11 16H13L13.1888 15.2446C13.2272 15.0913 13.3369 14.9674 13.4775 14.8955C13.5774 14.8444 13.6743 14.7883 13.7679 14.7275C13.9006 14.6414 14.0629 14.6082 14.215 14.6517L14.9641 14.866L15.9641 13.134L15.4037 12.5921C15.2902 12.4824 15.2377 12.3257 15.2457 12.168C15.2486 12.1124 15.25 12.0564 15.25 12C15.25 11.9436 15.2486 11.8876 15.2457 11.832C15.2377 11.6743 15.2902 11.5176 15.4037 11.4079Z", fill: "currentColor", fillRule: "evenodd" }) }));
|
|
4
|
+
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export { IconAcronymTs } from "./icon-acronym-ts";
|
|
6
6
|
export { IconAgents } from "./icon-agents";
|
|
7
|
+
export { IconApi } from "./icon-api";
|
|
7
8
|
export { IconArrowUpRightSmall } from "./icon-arrow-up-right-small";
|
|
8
9
|
export { IconCheck } from "./icon-check";
|
|
9
10
|
export { IconChevronDownSmall } from "./icon-chevron-down-small";
|
|
@@ -1 +1 @@
|
|
|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C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
// biome-ignore lint/performance/noBarrelFile: ok
|
|
6
6
|
export { IconAcronymTs } from "./icon-acronym-ts";
|
|
7
7
|
export { IconAgents } from "./icon-agents";
|
|
8
|
+
export { IconApi } from "./icon-api";
|
|
8
9
|
export { IconArrowUpRightSmall } from "./icon-arrow-up-right-small";
|
|
9
10
|
export { IconCheck } from "./icon-check";
|
|
10
11
|
export { IconChevronDownSmall } from "./icon-chevron-down-small";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
export function LogoIconVercel({ size = 16, className, }) {
|
|
3
|
-
return (_jsx("svg", { "aria-hidden": "true", className: className, fill: "none", height: size, role: "img", viewBox: "0 0
|
|
3
|
+
return (_jsx("svg", { "aria-hidden": "true", className: className, fill: "none", height: Math.round(size), role: "img", viewBox: "0 0 115 100", width: Math.round(size * (115 / 100)), xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { clipRule: "evenodd", d: "M57.5 0 115 100H0z", fill: "currentColor", fillRule: "evenodd" }) }));
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
export function LogoVercelOss({ size = 20, className, }) {
|
|
3
|
-
return (_jsx("svg", { "aria-hidden": "true", className: className, fill: "currentColor", height: size, role: "img", viewBox: "0 0
|
|
3
|
+
return (_jsx("svg", { "aria-hidden": "true", className: className, fill: "currentColor", height: size, role: "img", viewBox: "0 0 179 45", width: size * (179 / 45), children: _jsx("path", { d: "M82.9248 0C87.2354 2.40883e-05 90.9013 0.906895 93.9229 2.71973C96.9848 4.5327 99.3221 7.13141 100.934 10.5156C102.585 13.8595 103.411 17.8484 103.411 22.4814C103.411 27.1143 102.585 31.1025 100.934 34.4463C99.3221 37.7902 96.9848 40.3687 93.9229 42.1816C90.9013 43.9542 87.2355 44.8408 82.9248 44.8408C78.6945 44.8408 75.0482 43.9543 71.9863 42.1816C68.9245 40.3687 66.5678 37.7902 64.916 34.4463C63.3046 31.1025 62.4981 27.1143 62.498 22.4814C62.498 17.8484 63.3045 13.8595 64.916 10.5156C66.5678 7.13145 68.9245 4.5327 71.9863 2.71973C75.0482 0.906757 78.6945 0 82.9248 0ZM123.094 0C126.518 8.89397e-07 129.419 0.624212 131.796 1.87305C134.173 3.0817 136.046 4.75437 137.416 6.88965C138.786 9.02479 139.632 11.4821 139.954 14.2617L132.038 14.625C131.837 13.0538 131.352 11.684 130.587 10.5156C129.862 9.34727 128.855 8.44051 127.565 7.7959C126.317 7.11108 124.786 6.76855 122.973 6.76855C120.717 6.76859 118.924 7.29248 117.595 8.33984C116.306 9.34703 115.66 10.6966 115.66 12.3887C115.66 13.5569 115.923 14.5236 116.446 15.2891C117.01 16.0545 117.997 16.7201 119.407 17.2842C120.817 17.8079 122.792 18.3713 125.33 18.9756C129.157 19.7813 132.199 20.8087 134.455 22.0576C136.711 23.3066 138.323 24.7574 139.29 26.4092C140.257 28.0609 140.74 29.9547 140.74 32.0898C140.74 34.7085 140.076 36.9851 138.746 38.9189C137.417 40.8123 135.543 42.2826 133.126 43.3301C130.709 44.3373 127.868 44.8408 124.604 44.8408C121.059 44.8408 117.997 44.2166 115.419 42.9678C112.841 41.7189 110.806 39.9863 109.315 37.7705C107.865 35.5144 107.019 32.8954 106.777 29.9141L114.754 29.4307C114.996 31.2839 115.519 32.8553 116.325 34.1445C117.171 35.4337 118.28 36.4206 119.649 37.1055C121.059 37.75 122.752 38.0723 124.726 38.0723C126.418 38.0723 127.848 37.8706 129.017 37.4678C130.225 37.0246 131.131 36.4003 131.735 35.5947C132.38 34.7487 132.702 33.7213 132.702 32.5127C132.702 31.4251 132.441 30.4583 131.917 29.6123C131.393 28.726 130.386 27.9398 128.896 27.2549C127.405 26.5297 125.189 25.8245 122.248 25.1396C118.703 24.3339 115.862 23.4281 113.727 22.4209C111.591 21.3734 110.04 20.0837 109.073 18.5527C108.106 16.9816 107.623 15.0278 107.623 12.6914C107.623 10.1935 108.247 7.99706 109.496 6.10352C110.745 4.16971 112.518 2.67932 114.814 1.63184C117.111 0.544055 119.871 0 123.094 0ZM161.043 0C164.467 0 167.369 0.624113 169.746 1.87305C172.123 3.08169 173.996 4.75442 175.366 6.88965C176.736 9.02474 177.582 11.4821 177.904 14.2617L169.987 14.625C169.786 13.0539 169.302 11.6839 168.537 10.5156C167.812 9.34733 166.805 8.4405 165.516 7.7959C164.267 7.11104 162.736 6.7686 160.923 6.76855C158.667 6.76855 156.873 7.29235 155.544 8.33984C154.255 9.34702 153.61 10.6966 153.61 12.3887C153.61 13.5568 153.872 14.5237 154.396 15.2891C154.96 16.0545 155.947 16.7201 157.357 17.2842C158.767 17.8079 160.742 18.3713 163.279 18.9756C167.106 19.7813 170.148 20.8088 172.404 22.0576C174.66 23.3066 176.272 24.7574 177.239 26.4092C178.206 28.061 178.689 29.9546 178.689 32.0898C178.689 34.7085 178.025 36.9851 176.695 38.9189C175.366 40.8123 173.492 42.2826 171.075 43.3301C168.658 44.3373 165.817 44.8408 162.554 44.8408C159.009 44.8408 155.946 44.2167 153.368 42.9678C150.79 41.7189 148.755 39.9863 147.265 37.7705C145.814 35.5144 144.968 32.8954 144.727 29.9141L152.704 29.4307C152.946 31.2839 153.47 32.8553 154.275 34.1445C155.121 35.4336 156.229 36.4206 157.599 37.1055C159.009 37.7501 160.701 38.0722 162.675 38.0723C164.367 38.0723 165.797 37.8707 166.966 37.4678C168.174 37.0246 169.081 36.4004 169.686 35.5947C170.33 34.7487 170.652 33.7212 170.652 32.5127C170.652 31.425 170.39 30.4583 169.866 29.6123C169.342 28.726 168.335 27.9398 166.845 27.2549C165.354 26.5297 163.138 25.8245 160.197 25.1396C156.652 24.3339 153.812 23.428 151.677 22.4209C149.542 21.3734 147.99 20.0837 147.023 18.5527C146.057 16.9816 145.572 15.0279 145.572 12.6914C145.572 10.1935 146.197 7.99706 147.446 6.10352C148.695 4.16993 150.468 2.67927 152.764 1.63184C155.06 0.544101 157.82 4.55239e-05 161.043 0ZM49.9004 44.265675H0L24.9502 0.874023L49.9004 44.265675ZM82.9248 6.8291C80.3868 6.8291 78.1911 7.45338 76.3379 8.70215C74.4846 9.95108 73.0541 11.7443 72.0469 14.0811C71.08 16.4177 70.5967 19.2182 70.5967 22.4814C70.5967 25.7445 71.08 28.5443 72.0469 30.8809C73.0541 33.1773 74.4846 34.9503 76.3379 36.1992C78.1911 37.4077 80.3868 38.0117 82.9248 38.0117C85.5435 38.0117 87.7593 37.4078 89.5723 36.1992C91.4255 34.9503 92.8358 33.1773 93.8027 30.8809C94.8098 28.5443 95.3134 25.7445 95.3135 22.4814C95.3135 19.2182 94.8099 16.4177 93.8027 14.0811C92.8358 11.7443 91.4255 9.95108 89.5723 8.70215C87.7593 7.45327 85.5434 6.82913 82.9248 6.8291Z" }) }));
|
|
4
4
|
}
|
package/dist/cli/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import{program as T}from"commander";import{access as ce,copyFile as le}from"fs/promises";import{join as pe}from"path";import{cancel as de,intro as ge,isCancel as ue,log as fe,outro as me,spinner as he,text as we}from"@clack/prompts";import{spawn as te}from"child_process";import{readFileSync as se}from"fs";import{cp as ne,readFile as ae,rename as re,writeFile as ie}from"fs/promises";import{join as $}from"path";import{fileURLToPath as oe}from"url";var g="@vercel/geistdocs",m=(e,t=[],s={})=>new Promise((n,a)=>{let r=te(e,t,{stdio:"inherit",...s});r.on("error",a),r.on("close",i=>{if(i===0){n();return}a(new Error(`Command failed with exit code ${i}: ${[e,...t].join(" ")}`))})}),A=["dependencies","devDependencies","optionalDependencies","peerDependencies"],_=()=>JSON.parse(se(new URL("../../package.json",import.meta.url),"utf8")).version,P=async e=>{let t=$(e,"package.json"),s=await ae(t,"utf8");return JSON.parse(s)},x=async(e,t)=>{let s=$(e,"package.json");await ie(s,`${JSON.stringify(t,null,2)}
|
|
3
|
-
`,"utf8")},R=(e,t)=>{for(let s of A){let n=e[s];if(n&&t in n)return n[t]}},V=(e,t)=>!!R(e,t),b=(e,t,s)=>{let n=!1;for(let a of A){let r=e[a];r&&t in r&&(r[t]=s,n=!0)}return n},j=()=>oe(new URL("../../template",import.meta.url)),F=async e=>{await ne(j(),e,{recursive:!0});let t=$(e,".gitignore"),s=$(e,"_gitignore");try{await re(s,t)}catch{}};var ye=async e=>{await F(e)},Pe=async e=>{try{return await ce(e),!0}catch{return!1}},ve=async()=>{await Pe(".env.example")&&await le(".env.example",".env.local")},Te=async e=>{let t=await P(e),s=_();return b(t,g,s)?(await x(e,t),!0):!1},ke=async e=>{await m("pnpm",["install"],{cwd:e,env:process.env,stdio:"inherit"})},$e=async e=>{await m("git",["init"],{cwd:e,env:process.env,stdio:"inherit"}),await m("git",["add","."],{cwd:e,env:process.env,stdio:"inherit"}),await m("git",["commit","-m","\u2728 Initial commit"],{cwd:e,env:process.env,stdio:"inherit"})},xe=async()=>{let e=await we({message:"What is your project named?",placeholder:"my-app",validate(t){if(t.length===0)return"Please enter a project name."}});return ue(e)&&(de("Operation cancelled."),process.exit(0)),e.toString()},G=async e=>{try{ge("Let's start a Geistdocs project!");let t=process.cwd(),s=e.name||await xe(),n=he(),a=pe(t,s);n.start("Copying bundled template..."),await ye(s),n.message("Setting up environment variables..."),process.chdir(a),await ve(),n.message("Rewriting package dependency versions..."),await Te(a),n.message("Installing dependencies..."),await ke(a),e.disableGit||(n.message("Initializing Git repository..."),await $e(a)),n.stop("Project initialized successfully!"),me("Run `pnpm dev` to start the development server.")}catch(t){let s=t instanceof Error?t.message:`Failed to initialize project: ${t}`;fe.error(s),process.exit(1)}};import{readFileSync as be,writeFileSync as Fe}from"fs";import{mkdir as De,readFile as N,writeFile as Se}from"fs/promises";import{dirname as Ce,extname as Re,relative as M,resolve as S}from"path";import{intro as je,isCancel as Ee,log as h,multiselect as Ne,outro as D,spinner as Ue}from"@clack/prompts";import{glob as Oe}from"glob";import{Node as v,Project as Ie,SyntaxKind as Je}from"ts-morph";var Le="geistdocs.tsx",Ae="content/docs/**/*.mdx",U=".translation-cache.json",E=8,B=()=>({version:1,entries:{}}),_e=async e=>{let t=await N(e),{createHash:s}=await import("crypto");return s("sha256").update(t).digest("hex")},Ve=e=>{let t=S(process.cwd(),e);return be(t,"utf8")},z=e=>v.isObjectLiteralExpression(e)?e.getProperties().flatMap(t=>{if(v.isPropertyAssignment(t)){let s=t.getNameNode();if(v.isIdentifier(s)||v.isStringLiteral(s))return[s.getText().replaceAll(/['"]/g,"")]}return[]}).filter(Boolean):[],Ge=e=>{try{let t=new Ie({compilerOptions:{allowJs:!0,jsx:4,module:99,target:10},skipAddingFilesFromTsConfig:!0,useInMemoryFileSystem:!0}),s=Ve(e),r=t.createSourceFile(e,s,{overwrite:!0}).getVariableDeclarations().find(l=>l.getName()==="translations")?.getInitializer();if(!r)return[];if(v.isObjectLiteralExpression(r))return z(r);let i=r.getFirstDescendantByKind(Je.ObjectLiteralExpression);return i?z(i):[]}catch(t){let s=t instanceof Error?t.message:`${t}`;return h.warn(`Failed to read locales from ${e}: ${s}`),[]}},Be=async()=>{let e=await Ne({message:"Which locales should be translated?",options:[{value:"cn",label:"Chinese (cn)"},{value:"jp",label:"Japanese (jp)"},{value:"es",label:"Spanish (es)"},{value:"fr",label:"French (fr)"},{value:"de",label:"German (de)"}],required:!0});return Ee(e)&&(D("Translation cancelled"),process.exit(0)),e},ze=async e=>(await Oe(e,{cwd:process.cwd(),absolute:!0,nodir:!0})).sort(),He=async()=>{let e=S(process.cwd(),U);try{let t=await N(e,"utf8"),s=JSON.parse(t);return s.version!==1||!s.entries?B():{version:1,entries:s.entries}}catch{return B()}},H=e=>{let t=S(process.cwd(),U),s=JSON.stringify(e,null,2);Fe(t,s,"utf8")},Me=async e=>{let t=await Promise.all(e.map(async s=>[s,await _e(s)]));return Object.fromEntries(t)},Ke=(e,t)=>{let s=Re(e);return`${e.slice(0,-s.length)}.${t}${s}`},K=(e,t)=>`${M(process.cwd(),e)}::${t}`,qe=(e,t,s,n,a=!1)=>{let r=[],i=0;for(let l of t){let c=s[l];for(let o of e){let d=Ke(l,o),u=K(l,o),f=n.entries[u];if(!a&&f?.hash===c){i+=1;continue}r.push({locale:o,sourceFile:l,sourceHash:c,targetFile:d})}}return{tasks:r,skippedCount:i}},Xe=async e=>{await De(Ce(e),{recursive:!0})},We=async(e,t,s)=>{let n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:t,locale:s})});if(!n.ok){let r=await n.text();throw new Error(`API request failed (${n.status}): ${r}`)}let a=await n.json();if(!a.translation)throw new Error("API response did not include a translation");return a.translation},Ye=async(e,t,s)=>{let n=await N(e.sourceFile,"utf8"),a=await We(t,n,e.locale);await Xe(e.targetFile),await Se(e.targetFile,a,"utf8"),s.entries[K(e.sourceFile,e.locale)]={hash:e.sourceHash,updatedAt:new Date().toISOString()}},q=async(e,t)=>{je("Translate MDX content");let s=e??Ae,n=t.url||process.env.GEISTDOCS_TRANSLATE_URL||"https://geistdocs.com/translate",a=Ge(t.config??Le),r=await ze(s);r.length===0&&(h.error(`No MDX files found matching pattern: ${s}`),D("Translation cancelled"),process.exit(1)),h.info(`Found ${r.length} MDX file(s) matching pattern`),a.length===0&&(a=await Be());let i=S(process.cwd(),U),l=await He();await H(l),h.info(`Using cache: ${i}`);let c=await Me(r),{tasks:o,skippedCount:d}=qe(a,r,c,l,t.force);if(o.length===0){h.success("All translations are up to date!"),D(`Skipped ${d} file(s) (unchanged)`);return}let u=[];for(let y=0;y<o.length;y+=E)u.push(o.slice(y,y+E));h.info(`Processing ${o.length} translation(s) in ${u.length} batch(es) of up to ${E}`),d>0&&h.info(`Skipped ${d} translation(s) (unchanged)`);let f=Ue();f.start("Translating content...");let k=0;for(let y of u)await Promise.all(y.map(async L=>{await Ye(L,n,l),k+=1,f.message(`Translated ${k}/${o.length}: ${M(process.cwd(),L.targetFile)}`)})),await H(l);f.stop("Translation complete!"),D(`Created/updated ${o.length} file(s)`)};import{access as Ze,copyFile as Qe,mkdir as Z,rm as J}from"fs/promises";import{dirname as et,join as w}from"path";import{intro as tt,log as p,outro as C,spinner as Q}from"@clack/prompts";import{glob as st}from"glob";var nt=["**/*"],at=["content/docs/**"],O=".geistdocs-tmp",rt=async(e,t)=>{let s=w(e,t);await J(s,{recursive:!0,force:!0}),await Z(s,{recursive:!0})},I=async e=>await J(e,{recursive:!0,force:!0}),X=async(e,t,s)=>(await st(e,{cwd:s,nodir:!0,dot:!0,ignore:[".git/**",...t]})).sort(),it=async e=>{try{return await Ze(e),!0}catch{return!1}},ot=async(e,t,s)=>{let n=w(t,e),a=w(s,e);return await it(n)?(await Qe(n,a),{success:!0}):{success:!1,error:`Source file not found: ${n}`}},ct=async(e,t)=>{let s=w(t,e);return await J(s,{force:!0}),{success:!0}},W=20,Y=async(e,t,s)=>{let n=[];for(let a=0;a<e.length;a+=s){let r=e.slice(a,a+s),i=await Promise.all(r.map(t));n.push(...i)}return n},lt=async(e,t,s,n,a)=>{let r={success:[],deleted:[],failed:[]},i=[...new Set(e.map(c=>et(w(n,c))))];a.message(`Creating ${i.length} directories...`),await Promise.all(i.map(c=>Z(c,{recursive:!0}))),a.message(`Updating ${e.length} files...`);let l=await Y(e,async c=>{let o=await ot(c,s,n);return{file:c,...o}},W);for(let{file:c,success:o,error:d}of l)o?r.success.push(c):r.failed.push({file:c,error:d??"Unknown error"});if(t.length>0){a.message(`Deleting ${t.length} files...`);let c=await Y(t,async o=>{try{return await ct(o,n),{file:o,success:!0}}catch(d){let u=d instanceof Error?d.message:`${d}`;return{file:o,success:!1,error:u}}},W);for(let o of c)o.success?r.deleted.push(o.file):r.failed.push({file:o.file,error:o.error})}return r},pt=e=>{if(e.success.length>0){p.success(`Successfully updated ${e.success.length} files:`);for(let t of e.success)p.info(` \u2713 ${t}`)}if(e.deleted.length>0){p.success(`Deleted ${e.deleted.length} files:`);for(let t of e.deleted)p.info(` \u{1F5D1} ${t}`)}if(e.failed.length>0){p.warn(`Failed to update ${e.failed.length} files:`);for(let{file:t,error:s}of e.failed)p.error(` \u2717 ${t}: ${s}`)}},dt=e=>e.includes("canary")?"canary":"latest",gt=async e=>{let t=await fetch(`https://registry.npmjs.org/${encodeURIComponent(g)}`);if(!t.ok)throw new Error(`Failed to resolve ${g}@${e}`);let n=(await t.json())["dist-tags"]?.[e];if(!n)throw new Error(`Could not find dist-tag ${e} for ${g}`);return n},ut=async e=>{let t=await P(e),s=R(t,g);if(!s)return{currentVersion:s,nextVersion:void 0,updated:!1};let n=dt(s),a=await gt(n);return s===a?{currentVersion:s,nextVersion:a,updateTag:n,updated:!1}:(b(t,g,a),await x(e,t),{currentVersion:s,nextVersion:a,updateTag:n,updated:!0})},ft=async(e,t,s)=>{let n=await P(e);if(!V(n,g))return!1;t&&t.length>0&&p.warn("Ignoring file patterns for a package-based site. This update will bump the package version instead."),s?.sync&&p.warn("Ignoring --sync for a package-based site. Runtime updates now come from the package version.");let{currentVersion:a,nextVersion:r,updateTag:i,updated:l}=await ut(e);if(!l)return p.success(a?`@vercel/geistdocs is already at ${r} (${i}).`:"No package version update was needed."),C("Package-based site is already up to date."),!0;p.info(`Bumping ${g} from ${a} to ${r} (${i})`);let c=Q();return c.start("Installing updated package version..."),await m("pnpm",["install"],{cwd:e}),c.stop("Package update complete!"),C("Please review and test the upgraded package version."),!0},mt=async(e,t,s,n,a)=>{let r=w(e,O),i=Q(),l=a?.sync?r:t;i.start("Preparing template snapshot..."),a?.sync&&(await rt(e,O),await F(r)),i.message("Scanning for files...");let c=await X(s,n,l),o=[];if(a?.sync){i.message("Comparing with local files...");let u=await X(s,n,e),f=new Set(c);o=u.filter(k=>!f.has(k))}if(i.stop(`Found ${c.length} files to update`),c.length===0&&o.length===0){p.warn("No files matched the patterns. Nothing to update."),a?.sync&&await I(r),C("Update cancelled.");return}p.info(`Patterns: ${s.length}`),p.info(`Files to update: ${c.length}`),a?.sync&&p.info(`Files to delete: ${o.length}`),i.start("Updating files...");let d=await lt(c,o,l,e,i);a?.sync&&(i.message("Cleaning up..."),await I(r)),i.stop("Update complete!"),pt(d),C("Please review and test the changes carefully.")},ee=async(e,t)=>{let s=process.cwd(),n=j(),a=e&&e.length>0?e:nt,r=e&&e.length>0?[]:at;try{if(tt("Let's update your Geistdocs project!"),await ft(s,e,t))return;p.info("Template source: bundled package snapshot"),e&&e.length>0&&p.info(`Updating specific files: ${e.join(", ")}`),t?.sync&&p.info("Sync mode enabled: will delete files removed from template"),await mt(s,n,a,r,t)}catch(i){let l=i instanceof Error?i.message:`${i}`;try{await I(w(s,O))}catch{}p.error(`Failed to update project: ${l}`),process.exit(1)}};T.name("geistdocs").description("CLI for Geistdocs projects").version("1.16.0","-v, --version","Output the current version");T.command("init").description("Initialize a new Geistdocs project").option("--name <name>","Name of the project").option("--disable-git","Disable git initialization").action(G);T.command("update [files...]").description("Update a Geistdocs project (optionally specify files/patterns to update)").option("--sync","Delete local files that no longer exist in the template").action(ee);T.command("translate [pattern]").description("Translate MDX file(s) to one or more locales (default: content/docs/**/*.mdx)").option("--config <path>","Path to config file to load locales from (defaults to geistdocs.tsx)").option("--url <url>","Custom translation API URL (defaults to GEISTDOCS_TRANSLATE_URL or https://geistdocs.com/translate)").option("--force","Force re-translation of all files, ignoring cache").action(q);T.parse(process.argv);
|
|
3
|
+
`,"utf8")},R=(e,t)=>{for(let s of A){let n=e[s];if(n&&t in n)return n[t]}},V=(e,t)=>!!R(e,t),b=(e,t,s)=>{let n=!1;for(let a of A){let r=e[a];r&&t in r&&(r[t]=s,n=!0)}return n},j=()=>oe(new URL("../../template",import.meta.url)),F=async e=>{await ne(j(),e,{recursive:!0});let t=$(e,".gitignore"),s=$(e,"_gitignore");try{await re(s,t)}catch{}};var ye=async e=>{await F(e)},Pe=async e=>{try{return await ce(e),!0}catch{return!1}},ve=async()=>{await Pe(".env.example")&&await le(".env.example",".env.local")},Te=async e=>{let t=await P(e),s=_();return b(t,g,s)?(await x(e,t),!0):!1},ke=async e=>{await m("pnpm",["install"],{cwd:e,env:process.env,stdio:"inherit"})},$e=async e=>{await m("git",["init"],{cwd:e,env:process.env,stdio:"inherit"}),await m("git",["add","."],{cwd:e,env:process.env,stdio:"inherit"}),await m("git",["commit","-m","\u2728 Initial commit"],{cwd:e,env:process.env,stdio:"inherit"})},xe=async()=>{let e=await we({message:"What is your project named?",placeholder:"my-app",validate(t){if(t.length===0)return"Please enter a project name."}});return ue(e)&&(de("Operation cancelled."),process.exit(0)),e.toString()},G=async e=>{try{ge("Let's start a Geistdocs project!");let t=process.cwd(),s=e.name||await xe(),n=he(),a=pe(t,s);n.start("Copying bundled template..."),await ye(s),n.message("Setting up environment variables..."),process.chdir(a),await ve(),n.message("Rewriting package dependency versions..."),await Te(a),n.message("Installing dependencies..."),await ke(a),e.disableGit||(n.message("Initializing Git repository..."),await $e(a)),n.stop("Project initialized successfully!"),me("Run `pnpm dev` to start the development server.")}catch(t){let s=t instanceof Error?t.message:`Failed to initialize project: ${t}`;fe.error(s),process.exit(1)}};import{readFileSync as be,writeFileSync as Fe}from"fs";import{mkdir as De,readFile as N,writeFile as Se}from"fs/promises";import{dirname as Ce,extname as Re,relative as M,resolve as S}from"path";import{intro as je,isCancel as Ee,log as h,multiselect as Ne,outro as D,spinner as Ue}from"@clack/prompts";import{glob as Oe}from"glob";import{Node as v,Project as Ie,SyntaxKind as Je}from"ts-morph";var Le="geistdocs.tsx",Ae="content/docs/**/*.mdx",U=".translation-cache.json",E=8,B=()=>({version:1,entries:{}}),_e=async e=>{let t=await N(e),{createHash:s}=await import("crypto");return s("sha256").update(t).digest("hex")},Ve=e=>{let t=S(process.cwd(),e);return be(t,"utf8")},z=e=>v.isObjectLiteralExpression(e)?e.getProperties().flatMap(t=>{if(v.isPropertyAssignment(t)){let s=t.getNameNode();if(v.isIdentifier(s)||v.isStringLiteral(s))return[s.getText().replaceAll(/['"]/g,"")]}return[]}).filter(Boolean):[],Ge=e=>{try{let t=new Ie({compilerOptions:{allowJs:!0,jsx:4,module:99,target:10},skipAddingFilesFromTsConfig:!0,useInMemoryFileSystem:!0}),s=Ve(e),r=t.createSourceFile(e,s,{overwrite:!0}).getVariableDeclarations().find(l=>l.getName()==="translations")?.getInitializer();if(!r)return[];if(v.isObjectLiteralExpression(r))return z(r);let i=r.getFirstDescendantByKind(Je.ObjectLiteralExpression);return i?z(i):[]}catch(t){let s=t instanceof Error?t.message:`${t}`;return h.warn(`Failed to read locales from ${e}: ${s}`),[]}},Be=async()=>{let e=await Ne({message:"Which locales should be translated?",options:[{value:"cn",label:"Chinese (cn)"},{value:"jp",label:"Japanese (jp)"},{value:"es",label:"Spanish (es)"},{value:"fr",label:"French (fr)"},{value:"de",label:"German (de)"}],required:!0});return Ee(e)&&(D("Translation cancelled"),process.exit(0)),e},ze=async e=>(await Oe(e,{cwd:process.cwd(),absolute:!0,nodir:!0})).sort(),He=async()=>{let e=S(process.cwd(),U);try{let t=await N(e,"utf8"),s=JSON.parse(t);return s.version!==1||!s.entries?B():{version:1,entries:s.entries}}catch{return B()}},H=e=>{let t=S(process.cwd(),U),s=JSON.stringify(e,null,2);Fe(t,s,"utf8")},Me=async e=>{let t=await Promise.all(e.map(async s=>[s,await _e(s)]));return Object.fromEntries(t)},Ke=(e,t)=>{let s=Re(e);return`${e.slice(0,-s.length)}.${t}${s}`},K=(e,t)=>`${M(process.cwd(),e)}::${t}`,qe=(e,t,s,n,a=!1)=>{let r=[],i=0;for(let l of t){let c=s[l];for(let o of e){let d=Ke(l,o),u=K(l,o),f=n.entries[u];if(!a&&f?.hash===c){i+=1;continue}r.push({locale:o,sourceFile:l,sourceHash:c,targetFile:d})}}return{tasks:r,skippedCount:i}},Xe=async e=>{await De(Ce(e),{recursive:!0})},We=async(e,t,s)=>{let n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:t,locale:s})});if(!n.ok){let r=await n.text();throw new Error(`API request failed (${n.status}): ${r}`)}let a=await n.json();if(!a.translation)throw new Error("API response did not include a translation");return a.translation},Ye=async(e,t,s)=>{let n=await N(e.sourceFile,"utf8"),a=await We(t,n,e.locale);await Xe(e.targetFile),await Se(e.targetFile,a,"utf8"),s.entries[K(e.sourceFile,e.locale)]={hash:e.sourceHash,updatedAt:new Date().toISOString()}},q=async(e,t)=>{je("Translate MDX content");let s=e??Ae,n=t.url||process.env.GEISTDOCS_TRANSLATE_URL||"https://geistdocs.com/translate",a=Ge(t.config??Le),r=await ze(s);r.length===0&&(h.error(`No MDX files found matching pattern: ${s}`),D("Translation cancelled"),process.exit(1)),h.info(`Found ${r.length} MDX file(s) matching pattern`),a.length===0&&(a=await Be());let i=S(process.cwd(),U),l=await He();await H(l),h.info(`Using cache: ${i}`);let c=await Me(r),{tasks:o,skippedCount:d}=qe(a,r,c,l,t.force);if(o.length===0){h.success("All translations are up to date!"),D(`Skipped ${d} file(s) (unchanged)`);return}let u=[];for(let y=0;y<o.length;y+=E)u.push(o.slice(y,y+E));h.info(`Processing ${o.length} translation(s) in ${u.length} batch(es) of up to ${E}`),d>0&&h.info(`Skipped ${d} translation(s) (unchanged)`);let f=Ue();f.start("Translating content...");let k=0;for(let y of u)await Promise.all(y.map(async L=>{await Ye(L,n,l),k+=1,f.message(`Translated ${k}/${o.length}: ${M(process.cwd(),L.targetFile)}`)})),await H(l);f.stop("Translation complete!"),D(`Created/updated ${o.length} file(s)`)};import{access as Ze,copyFile as Qe,mkdir as Z,rm as J}from"fs/promises";import{dirname as et,join as w}from"path";import{intro as tt,log as p,outro as C,spinner as Q}from"@clack/prompts";import{glob as st}from"glob";var nt=["**/*"],at=["content/docs/**"],O=".geistdocs-tmp",rt=async(e,t)=>{let s=w(e,t);await J(s,{recursive:!0,force:!0}),await Z(s,{recursive:!0})},I=async e=>await J(e,{recursive:!0,force:!0}),X=async(e,t,s)=>(await st(e,{cwd:s,nodir:!0,dot:!0,ignore:[".git/**",...t]})).sort(),it=async e=>{try{return await Ze(e),!0}catch{return!1}},ot=async(e,t,s)=>{let n=w(t,e),a=w(s,e);return await it(n)?(await Qe(n,a),{success:!0}):{success:!1,error:`Source file not found: ${n}`}},ct=async(e,t)=>{let s=w(t,e);return await J(s,{force:!0}),{success:!0}},W=20,Y=async(e,t,s)=>{let n=[];for(let a=0;a<e.length;a+=s){let r=e.slice(a,a+s),i=await Promise.all(r.map(t));n.push(...i)}return n},lt=async(e,t,s,n,a)=>{let r={success:[],deleted:[],failed:[]},i=[...new Set(e.map(c=>et(w(n,c))))];a.message(`Creating ${i.length} directories...`),await Promise.all(i.map(c=>Z(c,{recursive:!0}))),a.message(`Updating ${e.length} files...`);let l=await Y(e,async c=>{let o=await ot(c,s,n);return{file:c,...o}},W);for(let{file:c,success:o,error:d}of l)o?r.success.push(c):r.failed.push({file:c,error:d??"Unknown error"});if(t.length>0){a.message(`Deleting ${t.length} files...`);let c=await Y(t,async o=>{try{return await ct(o,n),{file:o,success:!0}}catch(d){let u=d instanceof Error?d.message:`${d}`;return{file:o,success:!1,error:u}}},W);for(let o of c)o.success?r.deleted.push(o.file):r.failed.push({file:o.file,error:o.error})}return r},pt=e=>{if(e.success.length>0){p.success(`Successfully updated ${e.success.length} files:`);for(let t of e.success)p.info(` \u2713 ${t}`)}if(e.deleted.length>0){p.success(`Deleted ${e.deleted.length} files:`);for(let t of e.deleted)p.info(` \u{1F5D1} ${t}`)}if(e.failed.length>0){p.warn(`Failed to update ${e.failed.length} files:`);for(let{file:t,error:s}of e.failed)p.error(` \u2717 ${t}: ${s}`)}},dt=e=>e.includes("canary")?"canary":"latest",gt=async e=>{let t=await fetch(`https://registry.npmjs.org/${encodeURIComponent(g)}`);if(!t.ok)throw new Error(`Failed to resolve ${g}@${e}`);let n=(await t.json())["dist-tags"]?.[e];if(!n)throw new Error(`Could not find dist-tag ${e} for ${g}`);return n},ut=async e=>{let t=await P(e),s=R(t,g);if(!s)return{currentVersion:s,nextVersion:void 0,updated:!1};let n=dt(s),a=await gt(n);return s===a?{currentVersion:s,nextVersion:a,updateTag:n,updated:!1}:(b(t,g,a),await x(e,t),{currentVersion:s,nextVersion:a,updateTag:n,updated:!0})},ft=async(e,t,s)=>{let n=await P(e);if(!V(n,g))return!1;t&&t.length>0&&p.warn("Ignoring file patterns for a package-based site. This update will bump the package version instead."),s?.sync&&p.warn("Ignoring --sync for a package-based site. Runtime updates now come from the package version.");let{currentVersion:a,nextVersion:r,updateTag:i,updated:l}=await ut(e);if(!l)return p.success(a?`@vercel/geistdocs is already at ${r} (${i}).`:"No package version update was needed."),C("Package-based site is already up to date."),!0;p.info(`Bumping ${g} from ${a} to ${r} (${i})`);let c=Q();return c.start("Installing updated package version..."),await m("pnpm",["install"],{cwd:e}),c.stop("Package update complete!"),C("Please review and test the upgraded package version."),!0},mt=async(e,t,s,n,a)=>{let r=w(e,O),i=Q(),l=a?.sync?r:t;i.start("Preparing template snapshot..."),a?.sync&&(await rt(e,O),await F(r)),i.message("Scanning for files...");let c=await X(s,n,l),o=[];if(a?.sync){i.message("Comparing with local files...");let u=await X(s,n,e),f=new Set(c);o=u.filter(k=>!f.has(k))}if(i.stop(`Found ${c.length} files to update`),c.length===0&&o.length===0){p.warn("No files matched the patterns. Nothing to update."),a?.sync&&await I(r),C("Update cancelled.");return}p.info(`Patterns: ${s.length}`),p.info(`Files to update: ${c.length}`),a?.sync&&p.info(`Files to delete: ${o.length}`),i.start("Updating files...");let d=await lt(c,o,l,e,i);a?.sync&&(i.message("Cleaning up..."),await I(r)),i.stop("Update complete!"),pt(d),C("Please review and test the changes carefully.")},ee=async(e,t)=>{let s=process.cwd(),n=j(),a=e&&e.length>0?e:nt,r=e&&e.length>0?[]:at;try{if(tt("Let's update your Geistdocs project!"),await ft(s,e,t))return;p.info("Template source: bundled package snapshot"),e&&e.length>0&&p.info(`Updating specific files: ${e.join(", ")}`),t?.sync&&p.info("Sync mode enabled: will delete files removed from template"),await mt(s,n,a,r,t)}catch(i){let l=i instanceof Error?i.message:`${i}`;try{await I(w(s,O))}catch{}p.error(`Failed to update project: ${l}`),process.exit(1)}};T.name("geistdocs").description("CLI for Geistdocs projects").version("1.17.0","-v, --version","Output the current version");T.command("init").description("Initialize a new Geistdocs project").option("--name <name>","Name of the project").option("--disable-git","Disable git initialization").action(G);T.command("update [files...]").description("Update a Geistdocs project (optionally specify files/patterns to update)").option("--sync","Delete local files that no longer exist in the template").action(ee);T.command("translate [pattern]").description("Translate MDX file(s) to one or more locales (default: content/docs/**/*.mdx)").option("--config <path>","Path to config file to load locales from (defaults to geistdocs.tsx)").option("--url <url>","Custom translation API URL (defaults to GEISTDOCS_TRANSLATE_URL or https://geistdocs.com/translate)").option("--force","Force re-translation of all files, ignoring cache").action(q);T.parse(process.argv);
|
package/dist/footer.js
CHANGED
|
@@ -167,5 +167,5 @@ const resolveHref = (item) => item.external || item.href.startsWith("http")
|
|
|
167
167
|
? item.href
|
|
168
168
|
: `${VERCEL}${item.href}`;
|
|
169
169
|
const FooterGroup = ({ title, children, }) => (_jsxs("div", { children: [title ? (_jsx("h2", { className: "my-3 font-medium text-gray-1000 text-label-14", children: title })) : null, _jsx("ul", { className: "m-0 list-none p-0", children: children })] }));
|
|
170
|
-
const FooterLink = ({ badge, children, external, href, }) => (_jsx("li", { className: "py-0.5 leading-5", children: _jsxs("a", { className: "-ml-0.5 flex w-fit items-center gap-1.5 p-0.5 text-gray-
|
|
170
|
+
const FooterLink = ({ badge, children, external, href, }) => (_jsx("li", { className: "py-0.5 leading-5", children: _jsxs("a", { className: "-ml-0.5 flex w-fit items-center gap-1.5 p-0.5 text-gray-900 transition-colors hover:text-gray-1000 motion-reduce:transition-none", href: href, rel: external ? "noopener" : undefined, target: external ? "_blank" : undefined, children: [children, badge ? (_jsx(Badge, { className: "h-5 bg-gray-200 px-2 text-[11px]/[20px] tabular-nums tracking-[0.2px]", variant: "secondary", children: badge })) : null] }) }));
|
|
171
171
|
export const Footer = () => (_jsxs("footer", { className: "mx-auto max-w-[1448px] px-6 pt-10 pb-6 text-sm", children: [_jsxs("div", { className: cn("grid grid-cols-2 gap-6 md:grid-cols-3 lg:grid-cols-4 lg:gap-y-7 xl:grid-cols-6"), children: [FOOTER_GROUPS.map((group) => (_jsx(FooterGroup, { title: group.title, children: group.items.map((item) => (_jsx(FooterLink, { badge: item.badge, external: item.external, href: resolveHref(item), children: item.name }, item.href + item.name))) }, group.title))), _jsx(FooterGroup, { title: "Social", children: SOCIAL_LINKS.map((item) => (_jsx(FooterLink, { external: item.external, href: item.href, children: item.name }, item.name))) })] }), _jsxs("div", { className: "mt-10 flex items-center justify-between", children: [_jsx("a", { "aria-label": "Vercel", className: "inline-flex text-gray-1000", href: `${VERCEL}/home`, rel: "noopener", target: "_blank", children: _jsx(LogoIconVercel, { size: 16 }) }), _jsx(ThemeSwitcher, { small: true })] })] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navbar-logo.d.ts","sourceRoot":"","sources":["../../../src/internal/navbar/navbar-logo.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,SAAS,EAAuB,MAAM,OAAO,CAAC;AAK5D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAY9D,eAAO,MAAM,mBAAmB,gBAAgB,CAAC;AAEjD,eAAO,MAAM,oBAAoB,EAAE,yBAAyB,EAiF3D,CAAC;AAgGF;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,yBAAyB,EAAE,GAAG,SAAS,EACjD,aAAa,EAAE,MAAM,GAAG,SAAS,GAChC,yBAAyB,EAAE,CAI7B;AAED,KAAK,eAAe,GAAG;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,CACA;IACE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,KAAK,CAAC;IACf,IAAI,EAAE,SAAS,CAAC;IAChB,WAAW,CAAC,EAAE,yBAAyB,EAAE,CAAC;CAC3C,GACD;IACE,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB,IAAI,EAAE,SAAS,CAAC;CACjB,CACJ,CAAC;AAEF,wBAAgB,UAAU,CAAC,EACzB,SAAS,EACT,IAAU,EACV,GAAG,KAAK,EACT,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"navbar-logo.d.ts","sourceRoot":"","sources":["../../../src/internal/navbar/navbar-logo.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,SAAS,EAAuB,MAAM,OAAO,CAAC;AAK5D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAY9D,eAAO,MAAM,mBAAmB,gBAAgB,CAAC;AAEjD,eAAO,MAAM,oBAAoB,EAAE,yBAAyB,EAiF3D,CAAC;AAgGF;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,yBAAyB,EAAE,GAAG,SAAS,EACjD,aAAa,EAAE,MAAM,GAAG,SAAS,GAChC,yBAAyB,EAAE,CAI7B;AAED,KAAK,eAAe,GAAG;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,CACA;IACE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,KAAK,CAAC;IACf,IAAI,EAAE,SAAS,CAAC;IAChB,WAAW,CAAC,EAAE,yBAAyB,EAAE,CAAC;CAC3C,GACD;IACE,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB,IAAI,EAAE,SAAS,CAAC;CACjB,CACJ,CAAC;AAEF,wBAAgB,UAAU,CAAC,EACzB,SAAS,EACT,IAAU,EACV,GAAG,KAAK,EACT,EAAE,eAAe,2CAmJjB"}
|
|
@@ -138,16 +138,12 @@ export function NavbarLogo({ className, href = "/", ...props }) {
|
|
|
138
138
|
const ossSections = groupOssProducts(ossProducts.filter((product) => !product.featured));
|
|
139
139
|
const [navOpen, setNavOpen] = useState(false);
|
|
140
140
|
const router = useRouter();
|
|
141
|
-
// The OSS trigger navigates via router.push (it's a button, not a Link, so
|
|
142
|
-
// keyboard focus reaches radix), which skips next/link's automatic prefetch.
|
|
143
|
-
// Warm the route on mount so clicking home is as fast as the prefetched
|
|
144
|
-
// <Link> nav items. The standard variant's logo is a real <Link> already.
|
|
145
141
|
useEffect(() => {
|
|
146
142
|
if (isOss) {
|
|
147
143
|
router.prefetch(href);
|
|
148
144
|
}
|
|
149
145
|
}, [isOss, router, href]);
|
|
150
|
-
return (_jsxs("span", { className: cn("flex items-center gap-2.5", className), children: [_jsx(Link, { className: "-mx-2 flex items-center rounded-md p-2 text-gray-1000 outline-none focus-visible:ring-2 focus-visible:ring-blue-700 focus-visible:ring-inset", href: isOss ? "https://vercel.com/oss" : "https://vercel.com/", rel: "noopener", target: "_blank", children: isOss ? (_jsxs(_Fragment, { children: [_jsx(LogoIconVercel, { className: "@min-[640px]:hidden", size: 18 }), _jsx(LogoVercelOss, { className: "@min-[640px]:block hidden", size: 18 })] })) : (_jsx(LogoIconVercel, { size: 18 })) }), _jsx("div", { className: "w-4 text-center text-gray-alpha-400 text-lg dark:text-gray-600", children: _jsx(IconSlashForward, {}) }), isOss ? (_jsxs(_Fragment, { children: [_jsx(Link, { className: "flex @min-[1024px]:hidden items-center text-gray-1000", href: href, children: props.logo }), _jsxs("div", { className: "@min-[1024px]:contents hidden", children: [_jsx(NavigationMenu, { delayDuration: 0, onValueChange: (value) => setNavOpen(Boolean(value)), skipDelayDuration: 0, viewport: false, children: _jsx(NavigationMenuList, { className: "h-16 items-stretch", children: _jsxs(NavigationMenuItem, { className: "flex h-full items-center", children: [_jsx(NavigationMenuTrigger, { className: "relative -mx-3 flex h-full items-center gap-1.5 px-3 text-gray-1000 outline-none before:absolute before:inset-x-0 before:top-1/2 before:h-9 before:-translate-y-1/2 before:rounded-md before:content-[''] focus-visible:before:ring-2 focus-visible:before:ring-blue-700 focus-visible:before:ring-inset", onClick: (e) => {
|
|
146
|
+
return (_jsxs("span", { className: cn("flex items-center gap-2.5", className), children: [_jsx(Link, { className: "-mx-2 flex items-center rounded-md p-2 text-gray-1000 outline-none focus-visible:ring-2 focus-visible:ring-blue-700 focus-visible:ring-inset", href: isOss ? "https://vercel.com/oss" : "https://vercel.com/", rel: "noopener", target: "_blank", children: isOss ? (_jsxs(_Fragment, { children: [_jsx(LogoIconVercel, { className: "@min-[640px]:hidden", size: 18 }), _jsx(LogoVercelOss, { className: "@min-[640px]:block hidden shrink-0", size: (18 * 45) / 43.391_652 })] })) : (_jsx(LogoIconVercel, { size: 18 })) }), _jsx("div", { className: "w-4 text-center text-gray-alpha-400 text-lg dark:text-gray-600", children: _jsx(IconSlashForward, {}) }), isOss ? (_jsxs(_Fragment, { children: [_jsx(Link, { className: "flex @min-[1024px]:hidden items-center text-gray-1000", href: href, children: props.logo }), _jsxs("div", { className: "@min-[1024px]:contents hidden", children: [_jsx(NavigationMenu, { delayDuration: 0, onValueChange: (value) => setNavOpen(Boolean(value)), skipDelayDuration: 0, viewport: false, children: _jsx(NavigationMenuList, { className: "h-16 items-stretch", children: _jsxs(NavigationMenuItem, { className: "flex h-full items-center", children: [_jsx(NavigationMenuTrigger, { className: "relative -mx-3 flex h-full items-center gap-1.5 px-3 text-gray-1000 outline-none before:absolute before:inset-x-0 before:top-1/2 before:h-9 before:-translate-y-1/2 before:rounded-md before:content-[''] focus-visible:before:ring-2 focus-visible:before:ring-blue-700 focus-visible:before:ring-inset", onClick: (e) => {
|
|
151
147
|
if (e.detail !== 0) {
|
|
152
148
|
router.push(href);
|
|
153
149
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-actions-client.d.ts","sourceRoot":"","sources":["../../src/internal/page-actions-client.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAGL,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAmBjD,UAAU,gBAAgB;IACxB,MAAM,EAAE,IAAI,CACV,eAAe,EACf,IAAI,GAAG,UAAU,GAAG,QAAQ,GAAG,aAAa,GAAG,QAAQ,CACxD,CAAC;IACF;;;;OAIG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B,IAAI,EAAE;QACJ,WAAW,EAAE,MAAM,CAAC;QACpB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;CACH;AAED,UAAU,oCAAoC;IAC5C,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,aAAa,GAAG,QAAQ,CAAC,CAAC;IACrE,YAAY,EAAE,SAAS,EAAE,CAAC;CAC3B;
|
|
1
|
+
{"version":3,"file":"page-actions-client.d.ts","sourceRoot":"","sources":["../../src/internal/page-actions-client.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAGL,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAmBjD,UAAU,gBAAgB;IACxB,MAAM,EAAE,IAAI,CACV,eAAe,EACf,IAAI,GAAG,UAAU,GAAG,QAAQ,GAAG,aAAa,GAAG,QAAQ,CACxD,CAAC;IACF;;;;OAIG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B,IAAI,EAAE;QACJ,WAAW,EAAE,MAAM,CAAC;QACpB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;CACH;AAED,UAAU,oCAAoC;IAC5C,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,aAAa,GAAG,QAAQ,CAAC,CAAC;IACrE,YAAY,EAAE,SAAS,EAAE,CAAC;CAC3B;AAgnBD,eAAO,MAAM,oBAAoB,GAAI,yBAIlC,gBAAgB,mDAqHlB,CAAC;AAEF,eAAO,MAAM,+BAA+B,GAAI,2BAG7C,oCAAoC,4CAiBtC,CAAC"}
|
|
@@ -82,8 +82,8 @@ const ProviderMenuView = ({ backRef, onBack, providers, query, }) => (_jsxs(_Fra
|
|
|
82
82
|
event.preventDefault();
|
|
83
83
|
onBack();
|
|
84
84
|
}, ref: backRef, children: [_jsx(ChevronLeftIcon, { className: "size-4" }), _jsx("span", { children: "Back to page actions" })] }), _jsx(DropdownMenuSeparator, {}), _jsx(OpenInProviderItems, { providers: providers, query: query })] }));
|
|
85
|
-
const PageActionsMainMenu = ({ askAIEnabled, checked, copyEnabled, copyIcon, editSourceEnabled, editSourceUrl, handleCopy, isMobile,
|
|
86
|
-
return (_jsxs(_Fragment, { children: [copyEnabled ? (_jsxs(_Fragment, { children: [_jsx(DropdownMenuItem, { asChild: true, className: "h-auto w-full p-2", children: _jsx("button", { onClick: handleCopy, type: "button", children: _jsx(PageActionMenuItemContent, { description: "Copy page as Markdown for LLMs", icon: copyIcon, title: checked ? "Copied" : "Copy page" }) }) }), _jsx(DropdownMenuItem, { asChild: true, className: "h-auto p-2", children: _jsx("
|
|
85
|
+
const PageActionsMainMenu = ({ askAIEnabled, checked, copyEnabled, copyIcon, editSourceEnabled, editSourceUrl, handleCopy, isMobile, onAskAI, onShowProviders, onViewMarkdown, openInChatEnabled, openInChatRef, otherProviders, query, v0Provider, }) => {
|
|
86
|
+
return (_jsxs(_Fragment, { children: [copyEnabled ? (_jsxs(_Fragment, { children: [_jsx(DropdownMenuItem, { asChild: true, className: "h-auto w-full p-2", children: _jsx("button", { onClick: handleCopy, type: "button", children: _jsx(PageActionMenuItemContent, { description: "Copy page as Markdown for LLMs", icon: copyIcon, title: checked ? "Copied" : "Copy page" }) }) }), _jsx(DropdownMenuItem, { asChild: true, className: "h-auto w-full p-2", children: _jsx("button", { onClick: onViewMarkdown, type: "button", children: _jsx(PageActionMenuItemContent, { description: "Open this page as plain text", icon: _jsx(SiMarkdown, { "aria-hidden": "true", className: "size-4" }), title: "View as Markdown" }) }) })] })) : null, openInChatEnabled ? (_jsxs(_Fragment, { children: [_jsx(DropdownMenuItem, { asChild: true, className: "h-auto p-2", children: _jsx("a", { href: v0Provider.getHref(query), rel: "noopener noreferrer", target: "_blank", children: _jsx(PageActionMenuItemContent, { description: "Ask v0 to help apply this page", icon: _jsx(SiV0, { "aria-hidden": "true", className: "size-4" }), title: v0Provider.label }) }) }), isMobile ? (_jsxs(DropdownMenuItem, { className: "h-auto p-2", onSelect: (event) => {
|
|
87
87
|
event.preventDefault();
|
|
88
88
|
onShowProviders();
|
|
89
89
|
}, ref: openInChatRef, children: [_jsx(PageActionMenuItemContent, { description: "Use this page in another AI chat", icon: _jsx(ExternalLinkIcon, { className: "size-4" }), title: "Open in another chat" }), _jsx(ChevronRightIcon, { className: "size-4" })] })) : (_jsxs(DropdownMenuSub, { children: [_jsx(DropdownMenuSubTrigger, { className: "h-auto p-2", children: _jsx(PageActionMenuItemContent, { description: "Use this page in another AI chat", icon: _jsx(ExternalLinkIcon, { className: "size-4" }), title: "Open in another chat" }) }), _jsx(DropdownMenuSubContent, { className: "w-52", sideOffset: 12, children: _jsx(OpenInProviderItems, { providers: otherProviders, query: query }) })] }))] })) : null, askAIEnabled ? (_jsx(DropdownMenuItem, { className: "h-auto p-2", onSelect: onAskAI, children: _jsx(PageActionMenuItemContent, { description: "Chat with this page as context", icon: _jsx(MessageCircleIcon, { className: "size-4" }), title: "Ask AI about this page" }) })) : null, editSourceEnabled ? (_jsx(DropdownMenuItem, { asChild: true, className: "h-auto p-2", children: _jsx("a", { href: editSourceUrl, rel: "noopener noreferrer", target: "_blank", children: _jsx(PageActionMenuItemContent, { description: "Suggest changes to this page", icon: _jsx(SiGithub, { "aria-hidden": "true", className: "size-4" }), title: "Edit this page on GitHub" }) }) })) : null] }));
|
|
@@ -130,13 +130,13 @@ const FeedbackAction = ({ siteId }) => {
|
|
|
130
130
|
};
|
|
131
131
|
// The mobile action row: three primary actions rendered inline below the
|
|
132
132
|
// page description.
|
|
133
|
-
const InlinePageActions = ({ askAIEnabled, checked, copyEnabled,
|
|
133
|
+
const InlinePageActions = ({ askAIEnabled, checked, copyEnabled, onAskAI, onCopy, onViewMarkdown, }) => {
|
|
134
134
|
const CopyStateIcon = checked ? CheckIcon : CopyIcon;
|
|
135
|
-
return (_jsxs("div", { className: "flex items-center gap-3 border-b pb-3 text-label-12", children: [copyEnabled ? (_jsxs(_Fragment, { children: [_jsxs("button", { className: inlineActionClassName, onClick: onCopy, type: "button", children: [_jsx(CopyStateIcon, {}), _jsx("span", { children: checked ? "Copied" : "Copy for LLM" })] }), _jsx("span", { "aria-hidden": "true", className: "h-4 w-px shrink-0 bg-gray-alpha-400 max-sm:hidden" }), _jsxs("
|
|
135
|
+
return (_jsxs("div", { className: "flex items-center gap-3 border-b pb-3 text-label-12", children: [copyEnabled ? (_jsxs(_Fragment, { children: [_jsxs("button", { className: inlineActionClassName, onClick: onCopy, type: "button", children: [_jsx(CopyStateIcon, {}), _jsx("span", { children: checked ? "Copied" : "Copy for LLM" })] }), _jsx("span", { "aria-hidden": "true", className: "h-4 w-px shrink-0 bg-gray-alpha-400 max-sm:hidden" }), _jsxs("button", { className: `${inlineActionClassName} max-sm:hidden`, onClick: onViewMarkdown, type: "button", children: [_jsx(SiMarkdown, { "aria-hidden": "true" }), _jsx("span", { children: "View Markdown" })] })] })) : null, copyEnabled && askAIEnabled ? (_jsx("span", { "aria-hidden": "true", className: "h-4 w-px shrink-0 bg-gray-alpha-400" })) : null, askAIEnabled ? (_jsxs("button", { className: inlineActionClassName, onClick: onAskAI, type: "button", children: [_jsx(MessageCircleIcon, {}), _jsx("span", { children: "Ask AI about this page" })] })) : null] }));
|
|
136
136
|
};
|
|
137
137
|
// The desktop action control: a compact copy button plus an actions dropdown,
|
|
138
138
|
// aligned beside the page title.
|
|
139
|
-
const DesktopPageActions = ({ askAIEnabled, checked, copyEnabled, editSourceEnabled, editSourceUrl, isMobile,
|
|
139
|
+
const DesktopPageActions = ({ askAIEnabled, checked, copyEnabled, editSourceEnabled, editSourceUrl, isMobile, menuView, onAskAI, onCopy, onViewMarkdown, openInChatEnabled, openInChatRef, otherProviders, providersBackRef, query, setMenuView, v0Provider, }) => {
|
|
140
140
|
const CopyStateIcon = checked ? CheckIcon : CopyIcon;
|
|
141
141
|
return (_jsxs(ButtonGroup, { children: [copyEnabled ? (_jsxs(Button, { "aria-label": "Copy page", className: "touch-manipulation", onClick: onCopy, size: "sm", type: "button", variant: "outline", children: [_jsx(CopyStateIcon, { className: "size-4" }), _jsxs("span", { className: "relative hidden md:inline-block", children: [_jsx("span", { className: "invisible", children: "Copy page" }), _jsx("span", { className: "absolute inset-0", children: checked ? "Copied" : "Copy page" })] })] })) : null, _jsxs(DropdownMenu, { onOpenChange: (open) => {
|
|
142
142
|
if (!open) {
|
|
@@ -145,10 +145,10 @@ const DesktopPageActions = ({ askAIEnabled, checked, copyEnabled, editSourceEnab
|
|
|
145
145
|
}, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(Button, { "aria-label": copyEnabled ? "Open page actions" : "Page actions", className: copyEnabled ? "touch-manipulation px-2" : undefined, size: "sm", type: "button", variant: "outline", children: [copyEnabled ? null : _jsx("span", { children: "Page actions" }), _jsx(ChevronDownIcon, { className: "size-4" })] }) }), _jsx(DropdownMenuContent, { align: "end", className: "w-80 max-w-[calc(100vw-1rem)]", sideOffset: 8, children: isMobile && menuView === "providers" ? (_jsx(ProviderMenuView, { backRef: providersBackRef, onBack: () => {
|
|
146
146
|
setMenuView("main");
|
|
147
147
|
requestAnimationFrame(() => openInChatRef.current?.focus());
|
|
148
|
-
}, providers: otherProviders, query: query })) : (_jsx(PageActionsMainMenu, { askAIEnabled: askAIEnabled, checked: checked, copyEnabled: copyEnabled, copyIcon: _jsx(CopyStateIcon, { className: "size-4" }), editSourceEnabled: editSourceEnabled, editSourceUrl: editSourceUrl, handleCopy: onCopy, isMobile: isMobile,
|
|
148
|
+
}, providers: otherProviders, query: query })) : (_jsx(PageActionsMainMenu, { askAIEnabled: askAIEnabled, checked: checked, copyEnabled: copyEnabled, copyIcon: _jsx(CopyStateIcon, { className: "size-4" }), editSourceEnabled: editSourceEnabled, editSourceUrl: editSourceUrl, handleCopy: onCopy, isMobile: isMobile, onAskAI: onAskAI, onShowProviders: () => {
|
|
149
149
|
setMenuView("providers");
|
|
150
150
|
requestAnimationFrame(() => providersBackRef.current?.focus());
|
|
151
|
-
}, openInChatEnabled: openInChatEnabled, openInChatRef: openInChatRef, otherProviders: otherProviders, query: query, v0Provider: v0Provider })) })] })] }));
|
|
151
|
+
}, onViewMarkdown: onViewMarkdown, openInChatEnabled: openInChatEnabled, openInChatRef: openInChatRef, otherProviders: otherProviders, query: query, v0Provider: v0Provider })) })] })] }));
|
|
152
152
|
};
|
|
153
153
|
export const GeistdocsPageActions = ({ config, page, only, }) => {
|
|
154
154
|
const isMobile = useIsMobile();
|
|
@@ -157,13 +157,37 @@ export const GeistdocsPageActions = ({ config, page, only, }) => {
|
|
|
157
157
|
const openInChatRef = useRef(null);
|
|
158
158
|
const providersBackRef = useRef(null);
|
|
159
159
|
const markdownUrl = page.markdownUrl;
|
|
160
|
-
const
|
|
160
|
+
const fetchMarkdown = async () => {
|
|
161
161
|
const response = await fetch(markdownUrl);
|
|
162
162
|
if (!response.ok) {
|
|
163
163
|
throw new Error(`Failed to fetch markdown from ${markdownUrl}`);
|
|
164
164
|
}
|
|
165
|
-
|
|
165
|
+
return await response.text();
|
|
166
|
+
};
|
|
167
|
+
const [checked, handleCopy] = useCopyButton(async () => {
|
|
168
|
+
await navigator.clipboard.writeText(await fetchMarkdown());
|
|
166
169
|
});
|
|
170
|
+
const handleViewMarkdown = () => {
|
|
171
|
+
// Open synchronously so popup blockers allow the tab, then load the
|
|
172
|
+
// markdown into a blob URL — keeps `.md` URLs out of the address bar
|
|
173
|
+
// and browser history (agents should cite canonical page URLs).
|
|
174
|
+
const viewer = window.open("about:blank", "_blank");
|
|
175
|
+
if (!viewer) {
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
fetchMarkdown()
|
|
179
|
+
.then((markdown) => {
|
|
180
|
+
const blob = new Blob([markdown], {
|
|
181
|
+
type: "text/plain;charset=utf-8",
|
|
182
|
+
});
|
|
183
|
+
const blobUrl = URL.createObjectURL(blob);
|
|
184
|
+
viewer.location.href = blobUrl;
|
|
185
|
+
setTimeout(() => URL.revokeObjectURL(blobUrl), 60_000);
|
|
186
|
+
})
|
|
187
|
+
.catch(() => {
|
|
188
|
+
viewer.close();
|
|
189
|
+
});
|
|
190
|
+
};
|
|
167
191
|
const editSourceUrl = getEditSourceUrl({
|
|
168
192
|
github: config.github,
|
|
169
193
|
path: page.path,
|
|
@@ -189,7 +213,7 @@ export const GeistdocsPageActions = ({ config, page, only, }) => {
|
|
|
189
213
|
// Desktop variant aligns beside the title (self-end); the mobile variant is
|
|
190
214
|
// rendered below the description and left-aligned.
|
|
191
215
|
const rootClassName = only === "mobile" ? "@min-[961px]:hidden" : "self-end @max-[960px]:hidden";
|
|
192
|
-
return (_jsxs("div", { className: rootClassName, children: [showDesktop ? (_jsx(DesktopPageActions, { askAIEnabled: askAIEnabled, checked: checked, copyEnabled: copyEnabled, editSourceEnabled: editSourceEnabled, editSourceUrl: editSourceUrl, isMobile: isMobile,
|
|
216
|
+
return (_jsxs("div", { className: rootClassName, children: [showDesktop ? (_jsx(DesktopPageActions, { askAIEnabled: askAIEnabled, checked: checked, copyEnabled: copyEnabled, editSourceEnabled: editSourceEnabled, editSourceUrl: editSourceUrl, isMobile: isMobile, menuView: menuView, onAskAI: onAskAI, onCopy: handleCopy, onViewMarkdown: handleViewMarkdown, openInChatEnabled: openInChatEnabled, openInChatRef: openInChatRef, otherProviders: otherProviders, providersBackRef: providersBackRef, query: query, setMenuView: setMenuView, v0Provider: v0Provider })) : null, showMobile && (copyEnabled || askAIEnabled) ? (_jsx(InlinePageActions, { askAIEnabled: askAIEnabled, checked: checked, copyEnabled: copyEnabled, onAskAI: onAskAI, onCopy: handleCopy, onViewMarkdown: handleViewMarkdown })) : null, _jsx("span", { "aria-live": "polite", className: "sr-only", children: checked ? "Page copied" : "" })] }));
|
|
193
217
|
};
|
|
194
218
|
export const GeistdocsTableOfContentsActions = ({ config, extraActions, }) => {
|
|
195
219
|
const actions = [];
|
|
@@ -10,6 +10,7 @@ export interface SidebarRootGroup {
|
|
|
10
10
|
label?: ReactNode;
|
|
11
11
|
}
|
|
12
12
|
export declare const getSidebarItemBadge: (item: Item | undefined) => string | undefined;
|
|
13
|
+
export declare const getSidebarBadgeTone: (label: string) => string;
|
|
13
14
|
export declare const isExternalSidebarItem: (item: Item | undefined) => boolean;
|
|
14
15
|
export declare const isExternalSidebarUrl: (url: string) => boolean;
|
|
15
16
|
export declare const hasSeparateRootDisclosure: (node: SidebarSectionNode) => node is Folder;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar-tree.d.ts","sourceRoot":"","sources":["../../src/internal/sidebar-tree.ts"],"names":[],"mappings":"AAAA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,SAAS,KAAG,OACE,CAAC;AAElE,eAAO,MAAM,oBAAoB,GAAI,KAAK,MAAM,KAAG,OAC3B,CAAC;AAEzB,eAAO,MAAM,yBAAyB,GACpC,MAAM,kBAAkB,KACvB,IAAI,IAAI,MAGwB,CAAC;AAEpC,eAAO,MAAM,gBAAgB,GAC3B,MAAM,IAAI,EACV,MAAM,MAAM,EAAE,EACd,cAAiB,KAChB,MAAuD,CAAC;AAE3D,eAAO,MAAM,eAAe,GAAI,MAAM,IAAI,EAAE,KAAK,MAAM,KAAG,OAczD,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAChC,OAAO,IAAI,EAAE,EACb,WAAW,MAAM,GAAG,SAAS,KAC5B,MAAM,GAAG,IAgBX,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,SAAS,MAAM,GAAG,IAAI,KAAG,IAAI,EAsBnE,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,OAAO,IAAI,EAAE,KAAG,gBAAgB,EA8BpE,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAClC,OAAO,IAAI,EAAE,EACb,WAAW,MAAM,GAAG,SAAS,EAC7B,wBAAsB,EACtB,cAAiB,KAChB,MAAM,EAyBR,CAAC;AAEF,eAAO,MAAM,sBAAsB,GACjC,QAAQ,MAAM,EACd,YAAY,MAAM,EAAE,EACpB,cAAiB,KAChB,MAAM,EAiBR,CAAC"}
|
|
@@ -4,6 +4,15 @@ export const getSidebarItemBadge = (item) => {
|
|
|
4
4
|
const badge = item?.badge;
|
|
5
5
|
return typeof badge === "string" && badge.length > 0 ? badge : undefined;
|
|
6
6
|
};
|
|
7
|
+
const METHOD_BADGE_TONES = {
|
|
8
|
+
DEL: "bg-red-100 text-red-900",
|
|
9
|
+
DELETE: "bg-red-100 text-red-900",
|
|
10
|
+
GET: "bg-green-100 text-green-900",
|
|
11
|
+
PATCH: "bg-amber-100 text-amber-900",
|
|
12
|
+
POST: "bg-blue-100 text-blue-900",
|
|
13
|
+
PUT: "bg-amber-100 text-amber-900",
|
|
14
|
+
};
|
|
15
|
+
export const getSidebarBadgeTone = (label) => METHOD_BADGE_TONES[label] ?? "bg-blue-100 text-blue-900";
|
|
7
16
|
export const isExternalSidebarItem = (item) => Boolean(item && (item.external || EXTERNAL_URL.test(item.url)));
|
|
8
17
|
export const isExternalSidebarUrl = (url) => EXTERNAL_URL.test(url);
|
|
9
18
|
export const hasSeparateRootDisclosure = (node) => node.type === "folder" &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../src/internal/sidebar.tsx"],"names":[],"mappings":"AAOA,OAAO,EAEL,KAAK,SAAS,EAQf,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../src/internal/sidebar.tsx"],"names":[],"mappings":"AAOA,OAAO,EAEL,KAAK,SAAS,EAQf,MAAM,OAAO,CAAC;AAq3Bf,eAAO,MAAM,gBAAgB,GAAI,uBAG9B;IACD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,GAAG,CAAC,EAAE,SAAS,CAAC;CACjB,4CA8DA,CAAC"}
|
package/dist/internal/sidebar.js
CHANGED
|
@@ -11,7 +11,7 @@ import { SearchButton } from "../controls";
|
|
|
11
11
|
import { useGeistdocsSidebar } from "../sidebar";
|
|
12
12
|
import { cn } from "./cn";
|
|
13
13
|
import { observeSidebarContainer } from "./sidebar-responsive";
|
|
14
|
-
import { findActiveRootSection, getDescendantFolderIds, getInitialOpenFolderIds, getSidebarItemBadge, getSidebarNodeId, getSidebarRootGroups, getSidebarSectionItems, hasSeparateRootDisclosure, isExternalSidebarItem, isExternalSidebarUrl, } from "./sidebar-tree";
|
|
14
|
+
import { findActiveRootSection, getDescendantFolderIds, getInitialOpenFolderIds, getSidebarBadgeTone, getSidebarItemBadge, getSidebarNodeId, getSidebarRootGroups, getSidebarSectionItems, hasSeparateRootDisclosure, isExternalSidebarItem, isExternalSidebarUrl, } from "./sidebar-tree";
|
|
15
15
|
import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle, } from "./ui/sheet";
|
|
16
16
|
const UNSAFE_ID_CHARACTERS = /[^a-zA-Z0-9_-]/g;
|
|
17
17
|
const collectPageUrls = (nodes) => {
|
|
@@ -134,7 +134,7 @@ const getSidebarRowTone = (isSelected, isGroup) => {
|
|
|
134
134
|
return "text-gray-900 hover:bg-gray-alpha-100 hover:text-gray-1000 focus-visible:bg-gray-alpha-100 focus-visible:text-gray-1000 active:bg-gray-alpha-300";
|
|
135
135
|
};
|
|
136
136
|
const SidebarDisclosureIcon = ({ expanded }) => (_jsx(_Fragment, { children: expanded ? (_jsx(IconChevronDownSmall, { size: 16 })) : (_jsx(IconChevronRight, { size: 16 })) }));
|
|
137
|
-
const SidebarBadge = ({ label }) => label ? (_jsx("span", { className: "inline-flex h-6 max-w-24 shrink-0 items-center truncate rounded-full
|
|
137
|
+
const SidebarBadge = ({ label }) => label ? (_jsx("span", { className: cn("inline-flex h-6 max-w-24 shrink-0 items-center truncate rounded-full px-2 text-button-12", getSidebarBadgeTone(label)), children: label })) : null;
|
|
138
138
|
const SidebarTreeNode = ({ depth, node, path, state, }) => {
|
|
139
139
|
const nodeId = getSidebarNodeId(node, path, state.idScope);
|
|
140
140
|
if (node.type === "separator") {
|
package/dist/proxy.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxy.d.ts","sourceRoot":"","sources":["../src/proxy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"proxy.d.ts","sourceRoot":"","sources":["../src/proxy.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,WAAW,EAEjB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,KAAK,eAAe,EAGrB,MAAM,UAAU,CAAC;AAElB,MAAM,MAAM,eAAe,GACvB,UAAU,GACV,iBAAiB,GACjB,WAAW,GACX,IAAI,CAAC;AAET,MA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CACrB,KAAK,EAAE,yBAAyB,KAC7B,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CAC3B;AA8JD,eAAO,MAAM,WAAW,GAAI,kEAMzB,kBAAkB,MA0PL,SAAS,WAAW,EAAE,SAAS,cAAc,sBA6C5D,CAAC"}
|
package/dist/proxy.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { generateNotFoundMarkdown, isAIAgent } from "@vercel/agent-readability";
|
|
1
|
+
import { applyMarkdownHeaders, generateNotFoundMarkdown, isAIAgent, } from "@vercel/agent-readability";
|
|
2
2
|
import { defineI18n } from "fumadocs-core/i18n";
|
|
3
3
|
import { createI18nMiddleware } from "fumadocs-core/i18n/middleware";
|
|
4
4
|
import { isMarkdownPreferred } from "fumadocs-core/negotiation";
|
|
@@ -168,7 +168,15 @@ export const createProxy = ({ after, before, config, markdownRoutes, trackMarkdo
|
|
|
168
168
|
rewriteUrl.basePath = configuredBasePath;
|
|
169
169
|
}
|
|
170
170
|
rewriteUrl.pathname = result;
|
|
171
|
-
|
|
171
|
+
const response = NextResponse.rewrite(rewriteUrl);
|
|
172
|
+
// Vary: Accept keeps shared caches from serving markdown to browsers
|
|
173
|
+
// (or HTML to agents) on negotiated URLs; Link: rel="canonical" points
|
|
174
|
+
// crawlers at the public page URL instead of the markdown variant.
|
|
175
|
+
const canonicalPath = getPublicPath((options?.trackPath ?? pathname).replace(MDX_EXTENSION_PATTERN, ""), config.basePath);
|
|
176
|
+
applyMarkdownHeaders(response.headers, {
|
|
177
|
+
canonicalUrl: `${request.nextUrl.origin}${canonicalPath}`,
|
|
178
|
+
});
|
|
179
|
+
return response;
|
|
172
180
|
};
|
|
173
181
|
const isMdExtensionRequest = (pathname, language) => (pathname.endsWith(".md") || pathname.endsWith(".mdx")) &&
|
|
174
182
|
Boolean(resolveMarkdownRewrite(pathname.replace(MDX_EXTENSION_PATTERN, ""), language));
|
|
@@ -194,8 +202,11 @@ export const createProxy = ({ after, before, config, markdownRoutes, trackMarkdo
|
|
|
194
202
|
if (response) {
|
|
195
203
|
return response;
|
|
196
204
|
}
|
|
205
|
+
const notFoundHeaders = applyMarkdownHeaders(new Headers({ "Content-Type": "text/markdown; charset=utf-8" }), {
|
|
206
|
+
canonicalUrl: `${request.nextUrl.origin}${getPublicPath(trackPath, config.basePath)}`,
|
|
207
|
+
});
|
|
197
208
|
return new NextResponse(generateNotFoundMarkdown(pathname), {
|
|
198
|
-
headers:
|
|
209
|
+
headers: notFoundHeaders,
|
|
199
210
|
});
|
|
200
211
|
};
|
|
201
212
|
const handlePreferredMarkdownRequest = (request, context, pathname, language, trackPath) => isMarkdownPreferred(request)
|
package/dist/versions.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../src/versions.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAQhF,OAAO,EACL,KAAK,qBAAqB,EAE3B,MAAM,6BAA6B,CAAC;AAErC,YAAY,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEzE,MAAM,WAAW,wBAAwB;IACvC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,UAAU,uBAAuB,CAAC,IAAI,SAAS,wBAAwB;IACrE,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,IAAI,EAAE,IAAI,CAAC;I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,QAAQ,EAAE,sBAAsB,EAAE,GAAG,uBAAuB,CAAC;CAC9D;AAkED,eAAO,MAAM,gBAAgB,GAAI,IAAI,SAAS,wBAAwB,EAAE,kCAIrE,uBAAuB,CAAC,IAAI,CAAC,WA0B/B,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,wCAIhC,yBAAyB,WACgD,CAAC;AAE7E,eAAO,MAAM,oBAAoB,GAAI,IAAI,SAAS,wBAAwB,EAAE,uEAOzE,yBAAyB,CAAC,IAAI,CAAC,mDA0FjC,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,0CAKpC,2BAA2B,4CAqC7B,CAAC"}
|
package/dist/versions.js
CHANGED
|
@@ -17,7 +17,6 @@ const removeRoutePrefix = (pathname, item) => {
|
|
|
17
17
|
? pathname.slice(item.routePrefix.length) || "/"
|
|
18
18
|
: pathname;
|
|
19
19
|
};
|
|
20
|
-
const getVersionDescription = ({ current, version, }) => version.description ?? (current ? "Current version" : "Previous version");
|
|
21
20
|
const SelectIcon = ({ active, children, }) => (_jsx("span", { className: cn("flex size-9 shrink-0 items-center justify-center rounded-md border", active
|
|
22
21
|
? "border-blue-500 bg-blue-100 text-blue-900"
|
|
23
22
|
: "border-gray-alpha-400 bg-gray-100 text-gray-800"), children: children }));
|
|
@@ -98,5 +97,5 @@ export const GeistdocsVersionSelect = ({ className, current, paths, versions, })
|
|
|
98
97
|
})
|
|
99
98
|
: baseItems;
|
|
100
99
|
const currentId = current ?? (Array.isArray(versions) ? items[0]?.id : versions.current);
|
|
101
|
-
return (_jsx(GeistdocsRouteSelect, { ariaLabel: "Select documentation version", className: className, current: currentId,
|
|
100
|
+
return (_jsx(GeistdocsRouteSelect, { ariaLabel: "Select documentation version", className: className, current: currentId, items: items, renderIcon: ({ active, item }) => item.icon ? (_jsx(SelectIcon, { active: active, children: item.icon })) : (_jsx(VersionIcon, { active: active })) }));
|
|
102
101
|
};
|
package/docs/agents.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Geistdocs Package Docs
|
|
2
2
|
|
|
3
|
-
These docs are bundled with `@vercel/geistdocs` 1.
|
|
3
|
+
These docs are bundled with `@vercel/geistdocs` 1.17.0 so agents can understand the installed package without web access.
|
|
4
4
|
They are generated from `apps/template/content/docs` during the package build.
|
|
5
5
|
|
|
6
6
|
## How to use these files
|
package/docs/llms.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Geistdocs Package Documentation
|
|
2
2
|
|
|
3
|
-
These docs are bundled with `@vercel/geistdocs` 1.
|
|
3
|
+
These docs are bundled with `@vercel/geistdocs` 1.17.0.
|
|
4
4
|
They describe how to build package-backed Geistdocs sites and how to use the package APIs from generated project adapters.
|
|
5
5
|
|
|
6
6
|
## Documentation Index
|
|
@@ -1116,7 +1116,7 @@ badge: Beta
|
|
|
1116
1116
|
---
|
|
1117
1117
|
```
|
|
1118
1118
|
|
|
1119
|
-
The `title` property is required and is used for the page heading and navigation. The `description` is used for SEO and page previews. The optional `badge` appears beside the page label in desktop and mobile sidebar navigation.
|
|
1119
|
+
The `title` property is required and is used for the page heading and navigation. The `description` is used for SEO and page previews. The optional `badge` appears beside the page label in desktop and mobile sidebar navigation. Badge labels that match an uppercase HTTP method (`GET`, `POST`, `PUT`, `PATCH`, `DEL`, or `DELETE`) render with a method-specific color. See [Configure sidebar navigation](/docs/guides/nested-navigation) for the full color mapping.
|
|
1120
1120
|
|
|
1121
1121
|
## Basic Markdown
|
|
1122
1122
|
|
|
@@ -2699,6 +2699,29 @@ badge: Beta
|
|
|
2699
2699
|
|
|
2700
2700
|
Geistdocs renders the badge in desktop and mobile navigation. Badges also appear on folder landing pages because their sidebar items use the folder's `index.mdx` frontmatter. Keep badge text short so the page label has enough room to remain readable.
|
|
2701
2701
|
|
|
2702
|
+
## Show HTTP method badges on API reference pages
|
|
2703
|
+
|
|
2704
|
+
Badge labels that match an HTTP method render with a method-specific color, so readers can distinguish endpoint types in an API reference sidebar at a glance. Set `badge` to the uppercase method name:
|
|
2705
|
+
|
|
2706
|
+
```yaml title="content/docs/api-reference/get-user.mdx"
|
|
2707
|
+
---
|
|
2708
|
+
title: Get a user
|
|
2709
|
+
description: Retrieve a single user by ID.
|
|
2710
|
+
badge: GET
|
|
2711
|
+
---
|
|
2712
|
+
```
|
|
2713
|
+
|
|
2714
|
+
Geistdocs applies a color for each method:
|
|
2715
|
+
|
|
2716
|
+
| Badge label | Color |
|
|
2717
|
+
| ---------------- | ----- |
|
|
2718
|
+
| `GET` | Green |
|
|
2719
|
+
| `POST` | Blue |
|
|
2720
|
+
| `PUT`, `PATCH` | Amber |
|
|
2721
|
+
| `DEL`, `DELETE` | Red |
|
|
2722
|
+
|
|
2723
|
+
Method matching is case-sensitive, so use uppercase labels. `DEL` and `DELETE` render the same red badge, so prefer `DEL` when you want a narrower badge. Any other label, such as `Beta`, keeps the default blue badge. Badge colors adapt to light and dark themes automatically.
|
|
2724
|
+
|
|
2702
2725
|
## Add links to the navigation
|
|
2703
2726
|
|
|
2704
2727
|
The `pages` array can include internal and external links alongside content files:
|
package/docs/manifest.json
CHANGED
|
@@ -151,6 +151,29 @@ badge: Beta
|
|
|
151
151
|
|
|
152
152
|
Geistdocs renders the badge in desktop and mobile navigation. Badges also appear on folder landing pages because their sidebar items use the folder's `index.mdx` frontmatter. Keep badge text short so the page label has enough room to remain readable.
|
|
153
153
|
|
|
154
|
+
## Show HTTP method badges on API reference pages
|
|
155
|
+
|
|
156
|
+
Badge labels that match an HTTP method render with a method-specific color, so readers can distinguish endpoint types in an API reference sidebar at a glance. Set `badge` to the uppercase method name:
|
|
157
|
+
|
|
158
|
+
```yaml title="content/docs/api-reference/get-user.mdx"
|
|
159
|
+
---
|
|
160
|
+
title: Get a user
|
|
161
|
+
description: Retrieve a single user by ID.
|
|
162
|
+
badge: GET
|
|
163
|
+
---
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Geistdocs applies a color for each method:
|
|
167
|
+
|
|
168
|
+
| Badge label | Color |
|
|
169
|
+
| ---------------- | ----- |
|
|
170
|
+
| `GET` | Green |
|
|
171
|
+
| `POST` | Blue |
|
|
172
|
+
| `PUT`, `PATCH` | Amber |
|
|
173
|
+
| `DEL`, `DELETE` | Red |
|
|
174
|
+
|
|
175
|
+
Method matching is case-sensitive, so use uppercase labels. `DEL` and `DELETE` render the same red badge, so prefer `DEL` when you want a narrower badge. Any other label, such as `Beta`, keeps the default blue badge. Badge colors adapt to light and dark themes automatically.
|
|
176
|
+
|
|
154
177
|
## Add links to the navigation
|
|
155
178
|
|
|
156
179
|
The `pages` array can include internal and external links alongside content files:
|
package/docs/pages/syntax.md
CHANGED
|
@@ -29,7 +29,7 @@ badge: Beta
|
|
|
29
29
|
---
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
The `title` property is required and is used for the page heading and navigation. The `description` is used for SEO and page previews. The optional `badge` appears beside the page label in desktop and mobile sidebar navigation.
|
|
32
|
+
The `title` property is required and is used for the page heading and navigation. The `description` is used for SEO and page previews. The optional `badge` appears beside the page label in desktop and mobile sidebar navigation. Badge labels that match an uppercase HTTP method (`GET`, `POST`, `PUT`, `PATCH`, `DEL`, or `DELETE`) render with a method-specific color. See [Configure sidebar navigation](/docs/guides/nested-navigation) for the full color mapping.
|
|
33
33
|
|
|
34
34
|
## Basic Markdown
|
|
35
35
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/geistdocs",
|
|
3
3
|
"description": "Runtime and CLI for Geistdocs projects.",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.17.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -262,7 +262,7 @@
|
|
|
262
262
|
"@orama/tokenizers": "^3.1.16",
|
|
263
263
|
"@streamdown/cjk": "^1.0.1",
|
|
264
264
|
"@streamdown/code": "^1.0.1",
|
|
265
|
-
"@vercel/agent-readability": "^0.
|
|
265
|
+
"@vercel/agent-readability": "^0.5.0",
|
|
266
266
|
"@vercel/oidc": "^3.4.1",
|
|
267
267
|
"ai": "^6.0.132",
|
|
268
268
|
"class-variance-authority": "^0.7.1",
|
|
@@ -280,11 +280,17 @@
|
|
|
280
280
|
"next-themes": "^0.4.6",
|
|
281
281
|
"radix-ui": "1.6.4",
|
|
282
282
|
"react-player": "^3.4.0",
|
|
283
|
+
"remark-frontmatter": "^5.0.0",
|
|
284
|
+
"remark-gfm": "^4.0.1",
|
|
285
|
+
"remark-mdx": "^3.1.1",
|
|
286
|
+
"remark-parse": "^11.0.0",
|
|
283
287
|
"sonner": "^2.0.7",
|
|
284
288
|
"streamdown": "^2.1.0",
|
|
285
289
|
"tailwind-merge": "^3.4.0",
|
|
286
290
|
"ts-morph": "^27.0.2",
|
|
287
291
|
"tw-animate-css": "^1.4.0",
|
|
292
|
+
"unified": "^11.0.5",
|
|
293
|
+
"unist-util-visit": "^5.1.0",
|
|
288
294
|
"use-stick-to-bottom": "^1.1.1",
|
|
289
295
|
"vaul": "^1.1.2",
|
|
290
296
|
"zod": "^4.1.13"
|
|
@@ -298,10 +304,12 @@
|
|
|
298
304
|
"devDependencies": {
|
|
299
305
|
"@biomejs/biome": "^2.3.8",
|
|
300
306
|
"@types/glob": "^9.0.0",
|
|
307
|
+
"@types/mdast": "^4.0.4",
|
|
301
308
|
"@types/mdx": "^2.0.13",
|
|
302
309
|
"@types/node": "^24.10.1",
|
|
303
310
|
"@types/react": "^19.2.7",
|
|
304
311
|
"@types/react-dom": "^19.2.3",
|
|
312
|
+
"mdast-util-mdx-jsx": "^3.2.0",
|
|
305
313
|
"next": "16.2.6",
|
|
306
314
|
"react": "^19.2.3",
|
|
307
315
|
"react-dom": "^19.2.3",
|
|
@@ -148,6 +148,29 @@ badge: Beta
|
|
|
148
148
|
|
|
149
149
|
Geistdocs renders the badge in desktop and mobile navigation. Badges also appear on folder landing pages because their sidebar items use the folder's `index.mdx` frontmatter. Keep badge text short so the page label has enough room to remain readable.
|
|
150
150
|
|
|
151
|
+
## Show HTTP method badges on API reference pages
|
|
152
|
+
|
|
153
|
+
Badge labels that match an HTTP method render with a method-specific color, so readers can distinguish endpoint types in an API reference sidebar at a glance. Set `badge` to the uppercase method name:
|
|
154
|
+
|
|
155
|
+
```yaml title="content/docs/api-reference/get-user.mdx"
|
|
156
|
+
---
|
|
157
|
+
title: Get a user
|
|
158
|
+
description: Retrieve a single user by ID.
|
|
159
|
+
badge: GET
|
|
160
|
+
---
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Geistdocs applies a color for each method:
|
|
164
|
+
|
|
165
|
+
| Badge label | Color |
|
|
166
|
+
| ---------------- | ----- |
|
|
167
|
+
| `GET` | Green |
|
|
168
|
+
| `POST` | Blue |
|
|
169
|
+
| `PUT`, `PATCH` | Amber |
|
|
170
|
+
| `DEL`, `DELETE` | Red |
|
|
171
|
+
|
|
172
|
+
Method matching is case-sensitive, so use uppercase labels. `DEL` and `DELETE` render the same red badge, so prefer `DEL` when you want a narrower badge. Any other label, such as `Beta`, keeps the default blue badge. Badge colors adapt to light and dark themes automatically.
|
|
173
|
+
|
|
151
174
|
## Add links to the navigation
|
|
152
175
|
|
|
153
176
|
The `pages` array can include internal and external links alongside content files:
|
|
@@ -27,7 +27,7 @@ badge: Beta
|
|
|
27
27
|
---
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
The `title` property is required and is used for the page heading and navigation. The `description` is used for SEO and page previews. The optional `badge` appears beside the page label in desktop and mobile sidebar navigation.
|
|
30
|
+
The `title` property is required and is used for the page heading and navigation. The `description` is used for SEO and page previews. The optional `badge` appears beside the page label in desktop and mobile sidebar navigation. Badge labels that match an uppercase HTTP method (`GET`, `POST`, `PUT`, `PATCH`, `DEL`, or `DELETE`) render with a method-specific color. See [Configure sidebar navigation](/docs/guides/nested-navigation) for the full color mapping.
|
|
31
31
|
|
|
32
32
|
## Basic Markdown
|
|
33
33
|
|
package/template/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"@streamdown/code": "^1.0.1",
|
|
19
19
|
"@vercel/agent-readability": "^0.2.1",
|
|
20
20
|
"@vercel/analytics": "^1.6.1",
|
|
21
|
-
"@vercel/geistdocs": "1.
|
|
21
|
+
"@vercel/geistdocs": "1.17.0",
|
|
22
22
|
"@vercel/speed-insights": "^1.3.1",
|
|
23
23
|
"ai": "^6.0.132",
|
|
24
24
|
"class-variance-authority": "^0.7.1",
|