diff --git a/components/NotionPage.js b/components/NotionPage.js index 61b7fc56..ead0d0ba 100644 --- a/components/NotionPage.js +++ b/components/NotionPage.js @@ -3,6 +3,8 @@ import dynamic from 'next/dynamic' import mediumZoom from 'medium-zoom' import React from 'react' import { isBrowser } from '@/lib/utils' +import Image from 'next/image' +import Link from 'next/link' const Code = dynamic(() => import('react-notion-x/build/third-party/code').then((m) => m.Code), { ssr: false } @@ -59,12 +61,20 @@ const NotionPage = ({ post }) => { const cards = document.getElementsByClassName('notion-collection-card') for (const e of cards) { e.removeAttribute('href') + const links = e.querySelectorAll('.notion-link') + if (links && links.length > 0) { + for (const l of links) { + l.onclick = function() { + window.open('http://' + l.innerText) + } + } + } } } }, 800) addWatch4Dom() - }, []) + }) return