Skip to content

Commit

Permalink
use url instead of path
Browse files Browse the repository at this point in the history
  • Loading branch information
ntotten committed Dec 20, 2024
1 parent 10a54a0 commit 2379062
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 1 addition & 5 deletions src/mdx/static-images.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Root } from "mdast";
import path from "path";
import { Plugin } from "unified";
import { visit } from "unist-util-visit";
import type { VFile } from "vfile";
Expand All @@ -20,10 +19,7 @@ const rehypeStaticImages: Plugin<[], Root, Root> =
node.properties
) {
if (!node.properties.src.startsWith("http")) {
let url = path.resolve(
path.dirname(vfile.path),
node.properties.src,
);
let url = new URL(node.properties.src, vfile.path).pathname;
const relativePath = url.startsWith("/public/")
? url.substring("/public/".length)
: url;
Expand Down
2 changes: 2 additions & 0 deletions zudoku.config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type { ZudokuConfig } from "zudoku";
import { CogIcon, CopyIcon, FileTextIcon, ListEndIcon } from "zudoku/icons";
import { devPortal, docs, policies, programming } from "./sidebar.js";
import { BundlesTable } from "./src/BundlesTable";
import { DocusaurusDocsLicense } from "./src/DocusaurusDocsLicense";
import { EnterpriseFeature } from "./src/EnterpriseFeature";
import { GithubButton } from "./src/GithubButton";
import { HeadNavigation } from "./src/HeadNavigation";
Expand All @@ -16,6 +17,7 @@ const EmbeddedChat = lazy(() => import("./src/EmbeddedChat"));

const mdxComponents = {
Screenshot: (props: any) => <img {...props} />,
DocusaurusDocsLicense,
GithubButton,
ZupIt: (props: any) => <ZupIt {...props} />,
CodeEditorTabIcon: () => <FileTextIcon style={iconStyle} size={18} />,
Expand Down

0 comments on commit 2379062

Please sign in to comment.