fumadocs-core 13.2.1 → 13.2.2

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.
@@ -20,6 +20,12 @@ function remarkHeading({
20
20
  return (root, file) => {
21
21
  const toc = [];
22
22
  slugger.reset();
23
+ if (file.data.frontmatter) {
24
+ const frontmatter = file.data.frontmatter;
25
+ if (frontmatter._openapi?.toc) {
26
+ toc.push(...frontmatter._openapi.toc);
27
+ }
28
+ }
23
29
  visit(root, "heading", (heading) => {
24
30
  heading.data ||= {};
25
31
  heading.data.hProperties ||= {};
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  flattenNode,
3
3
  remarkHeading
4
- } from "../chunk-YKIM647L.js";
4
+ } from "../chunk-UQV4A7HQ.js";
5
5
  import {
6
6
  slash
7
7
  } from "../chunk-UWEEHUJV.js";
@@ -325,7 +325,10 @@ function remarkImage({
325
325
  const hasBlur = placeholder === "blur" && VALID_BLUR_EXT.some((ext) => src.endsWith(ext));
326
326
  importsToInject.push({
327
327
  variableName,
328
- importPath: slash(resolveSrc(src, publicDir))
328
+ importPath: slash(
329
+ // with imports, relative paths don't have to be absolute
330
+ src.startsWith("/") ? path.join(publicDir, src) : src
331
+ )
329
332
  });
330
333
  Object.assign(node, {
331
334
  type: "mdxJsxFlowElement",
@@ -417,6 +420,13 @@ function remarkStructure({
417
420
  slugger.reset();
418
421
  const data = { contents: [], headings: [] };
419
422
  let lastHeading = "";
423
+ if (file.data.frontmatter) {
424
+ const frontmatter = file.data.frontmatter;
425
+ if (frontmatter._openapi?.structuredData) {
426
+ data.headings.push(...frontmatter._openapi.structuredData.headings);
427
+ data.contents.push(...frontmatter._openapi.structuredData.contents);
428
+ }
429
+ }
420
430
  visit2(node, types, (element) => {
421
431
  if (element.type === "root") return;
422
432
  const content = flattenNode(element).trim();
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  remarkHeading
3
- } from "../chunk-YKIM647L.js";
3
+ } from "../chunk-UQV4A7HQ.js";
4
4
  import "../chunk-MLKGABMK.js";
5
5
 
6
6
  // src/server/get-toc.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-core",
3
- "version": "13.2.1",
3
+ "version": "13.2.2",
4
4
  "description": "The library for building a documentation website in Next.js",
5
5
  "keywords": [
6
6
  "NextJs",