diff --git a/docs/src/components/Tools/Bookmark.tsx b/docs/src/components/Tools/Bookmark.tsx index 6d8de538f..a679d7d2c 100644 --- a/docs/src/components/Tools/Bookmark.tsx +++ b/docs/src/components/Tools/Bookmark.tsx @@ -1,25 +1,31 @@ -import styles from './styles.module.css'; +import { useEffect, useRef } from 'react'; import Heading from '@theme/Heading'; -import Head from '@docusaurus/Head'; -import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; +import styles from './styles.module.css'; const BookmarkSVG = require('@site/static/img/bookmarklet.svg').default; export default function Bookmark(): JSX.Element { - const { siteConfig } = useDocusaurusContext(); + const ref = useRef(); + useEffect(() => { + const url = 'https://cdn.jsdelivr.net/gh/jcubic/lips@devel/lib/js/bookmark.js'; + fetch(url).then(function(res) { + return res.text(); + }).then(text => { + if (ref.current) { + ref.current.href = text; + } + }); + }, [ref.current]); return (
Bookmarklet - -