Skip to content

Commit d9f5e72

Browse files
committed
Clarify fully-qualified links URL structure in README
Document that generated URLs are siteUrl + docPath.md where siteUrl includes both the Docusaurus url and baseUrl. Also clarify that relative links resolve against the source file's directory, and that reference-style image definitions are left unchanged. Made-with: Cursor
1 parent b3f29a1 commit d9f5e72

1 file changed

Lines changed: 19 additions & 9 deletions

File tree

README.md

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ module.exports = {
9292
// self-contained for LLMs and external tools. (default: false)
9393
fullyQualifiedLinks: false,
9494

95-
// Override the site URL used when fullyQualifiedLinks is enabled.
96-
// By default the plugin reads context.siteConfig.url from your
97-
// Docusaurus config. (default: undefined — uses Docusaurus site URL)
98-
// siteUrl: 'https://example.com',
95+
// Override the base URL used when fullyQualifiedLinks is enabled.
96+
// By default the plugin uses context.siteConfig.url + baseUrl
97+
// from your Docusaurus config. (default: undefined — auto-detected)
98+
// siteUrl: 'https://example.com/docs',
9999
}],
100100
],
101101
};
@@ -109,18 +109,28 @@ This makes the raw markdown useful outside the browser — for example, when an
109109
LLM fetches a `.md` file, every link it encounters will be a fetchable URL
110110
rather than a relative path that only works on the website.
111111

112+
Generated URLs have the form `<siteUrl>/<docPath>.md`, where `<siteUrl>` is
113+
your Docusaurus `url` + `baseUrl` (e.g. `https://example.com/docs`) and
114+
`<docPath>` is the resolved path relative to the docs root. For example, a
115+
relative link `./algorithm/` in `std/index.md` becomes
116+
`https://example.com/docs/std/algorithm.md`.
117+
112118
The plugin handles two kinds of internal links:
113119

114120
- **Relative** (`./algorithm/`, `../types`) — resolved against the current
115-
page's URL directory, then converted to an absolute `.md` URL.
121+
file's directory (using `dirname` of the source path), then converted to a
122+
fully-qualified `.md` URL.
116123
- **Site-root-absolute** (`/docs/roadmap`, `/docs/manual/types#string-literals`)
117-
— converted directly to an absolute `.md` URL with the fragment preserved.
124+
— converted directly to a fully-qualified `.md` URL with the fragment
125+
preserved.
118126

119127
External links (`https://...`), anchor-only links (`#section`), and image
120-
references (`![alt](...)`) are left unchanged.
128+
references (both inline `![alt](...)` and reference-style `![alt][ref]`) are
129+
left unchanged.
121130

122-
The site URL is read from your Docusaurus `url` config by default. You can
123-
override it with the `siteUrl` option if needed.
131+
The base URL defaults to `url` + `baseUrl` from your Docusaurus config. You can
132+
override it with the `siteUrl` option if your production URL differs from the
133+
config.
124134

125135
### Custom icons
126136

0 commit comments

Comments
 (0)