Skip to content

Crawlee—A web scraping and browser automation library for Node.js to build reliable crawlers. In JavaScript and TypeScript. Extract data for AI, LLMs, RAG, or GPTs. Download HTML, PDF, JPG, PNG, and other files from websites. Works with Puppeteer, Playwright, Cheerio, JSDOM, and raw HTTP. Both headful and headless mode. With proxy rotation.

docs: treat local absolute links from readme as relative (#2287)

Martin Adámek009756fa5cbc
diff --git a/website/src/theme/MDXComponents/A.js b/website/src/theme/MDXComponents/A.js
new file mode 100644
index 000000000..2d3494cac
--- /dev/null
+++ b/website/src/theme/MDXComponents/A.js
@@ -0,0 +1,15 @@
+/* eslint-disable react/prop-types */
+import Link from '@docusaurus/Link';
+import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
+import React from 'react';
+
+export default function MDXA(props) {
+ const { siteConfig } = useDocusaurusContext();
+ if (props.href?.startsWith(siteConfig.url)) {
+ const { href, ...rest } = props;
+ rest.to = props.href.replace(siteConfig.url + siteConfig.baseUrl, '/');
+ props = rest;
+ }
+
+ return <Link {...props} />;
+}