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
28 changes: 26 additions & 2 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { readFileSync } from "fs";
import { resolve } from "path";
import { copyFileSync, mkdirSync, readFileSync, readdirSync, statSync } from "fs";
import { dirname, join, relative, resolve } from "path";
import { defineConfig, type HeadConfig } from "vitepress";
import { tabsMarkdownPlugin } from "vitepress-plugin-tabs";

Expand Down Expand Up @@ -50,6 +50,30 @@ export default defineConfig({
description: "Modern project management software",
cleanUrls: true,

buildEnd(siteConfig) {
// Copy source .md files into dist/ for Accept: text/markdown negotiation.
const srcDir = siteConfig.srcDir;
const outDir = siteConfig.outDir;

function walk(dir: string): void {
for (const entry of readdirSync(dir)) {
if (entry === ".vitepress" || entry === "public" || entry === "node_modules") continue;
const abs = join(dir, entry);
const stat = statSync(abs);
if (stat.isDirectory()) {
walk(abs);
} else if (stat.isFile() && abs.endsWith(".md")) {
const rel = relative(srcDir, abs);
const dest = join(outDir, rel);
mkdirSync(dirname(dest), { recursive: true });
copyFileSync(abs, dest);
}
}
}

walk(srcDir);
},

head: [
[
"link",
Expand Down
4 changes: 4 additions & 0 deletions docs/public/robots.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@ Disallow: /core-concepts/issues.html
Disallow: /core-concepts/projects/run-project
Disallow: /importers/github-imp

# Content Signals — AI content usage preferences
# https://contentsignals.org/
Content-Signal: search=yes, ai-train=yes, ai-input=yes

Sitemap: https://docs.plane.so/sitemap.xml
18 changes: 18 additions & 0 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
{
"cleanUrls": true,
"trailingSlash": false,
"headers": [
{
"source": "/(.*)",
"headers": [
{
"key": "Link",
"value": "</api-reference/introduction>; rel=\"service-doc\"; type=\"text/html\", </sitemap.xml>; rel=\"sitemap\"; type=\"application/xml\""
}
]
}
],
"redirects": [
{
"source": "/quick-start",
Expand Down Expand Up @@ -262,5 +273,12 @@
"source": "/performance/hyper-mode",
"destination": "/"
}
],
"rewrites": [
{
"source": "/:path*",
"has": [{ "type": "header", "key": "accept", "value": ".*text/markdown.*" }],
"destination": "/:path*.md"
}
Comment on lines +277 to +282
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

: "${PREVIEW_URL:?Set PREVIEW_URL to the Vercel preview origin, e.g. https://docs-git-branch.vercel.app}"

for path in "/" "/introduction/quickstart"; do
  echo "== HEAD ${path} with Accept: text/markdown =="
  curl -sSI -H "Accept: text/markdown" "${PREVIEW_URL%/}${path}" | sed -n '1,20p'
  echo
done

Repository: makeplane/docs

Length of output: 175


🏁 Script executed:

cat -n vercel.json | head -300

Repository: makeplane/docs

Length of output: 9452


🏁 Script executed:

cat -n docs/.vitepress/config.ts | head -100

Repository: makeplane/docs

Length of output: 4736


🏁 Script executed:

fd -t f "index.md" docs/

Repository: makeplane/docs

Length of output: 71


Add explicit root rewrite for Markdown negotiation.

The rewrite pattern /:path*/:path*.md will match the root path / and incorrectly rewrite it to /.md. Since docs/.vitepress/config.ts copies index.md as the homepage source for Markdown negotiation, requests to / with Accept: text/markdown will 404 or fail to resolve properly.

Proposed fix
   "rewrites": [
+    {
+      "source": "/",
+      "has": [{ "type": "header", "key": "accept", "value": ".*text/markdown.*" }],
+      "destination": "/index.md"
+    },
     {
       "source": "/:path*",
       "has": [{ "type": "header", "key": "accept", "value": ".*text/markdown.*" }],
       "destination": "/:path*.md"
     }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"rewrites": [
{
"source": "/:path*",
"has": [{ "type": "header", "key": "accept", "value": ".*text/markdown.*" }],
"destination": "/:path*.md"
}
"rewrites": [
{
"source": "/",
"has": [{ "type": "header", "key": "accept", "value": ".*text/markdown.*" }],
"destination": "/index.md"
},
{
"source": "/:path*",
"has": [{ "type": "header", "key": "accept", "value": ".*text/markdown.*" }],
"destination": "/:path*.md"
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@vercel.json` around lines 277 - 282, Add an explicit root rewrite before the
existing wildcard rule: instead of only having the rewrite object with "source":
"/:path*", "has": [{ "type": "header", "key": "accept", "value":
".*text/markdown.*" }], "destination": "/:path*.md", add a separate rule that
matches "source": "/" with the same "has" header condition and maps it to
"/index.md" (so "/" with Accept: text/markdown rewrites to "/index.md"); ensure
the root rule appears before the wildcard rewrite so the specific match takes
precedence.

]
}
Loading