diff --git a/src/_components.ts b/src/_components.ts index 0c18595..d424d55 100644 --- a/src/_components.ts +++ b/src/_components.ts @@ -2,6 +2,7 @@ import HR from './components/HR.astro' import MDXImage from './components/mdx/MDXImage.astro' import MDXCallout from './components/mdx/MDXCallout.astro' import MDXCodeBlock from './components/mdx/MDXCodeBlock.astro' +import MDXLink from './components/mdx/MDXLink.astro' export const components = { hr: HR, @@ -9,4 +10,5 @@ export const components = { MDXImage: MDXImage, MDXCallout: MDXCallout, pre: MDXCodeBlock, + a: MDXLink, } \ No newline at end of file diff --git a/src/components/mdx/MDXAccordion.astro b/src/components/mdx/MDXAccordion.astro new file mode 100644 index 0000000..22228ed --- /dev/null +++ b/src/components/mdx/MDXAccordion.astro @@ -0,0 +1,126 @@ +--- + +// I stole ALLLLLL of this from https://webreaper.dev/posts/astro-accessible-accordion/ + +interface Props { + title: string; +} + +const { title } = Astro.props as Props; + +import HR from "../HR.astro"; + +--- + + + + + + \ No newline at end of file diff --git a/src/components/mdx/MDXLink.astro b/src/components/mdx/MDXLink.astro new file mode 100644 index 0000000..e8dbaea --- /dev/null +++ b/src/components/mdx/MDXLink.astro @@ -0,0 +1,28 @@ +--- + +import Icon from '../Icon.astro' + +interface Props { + href: string + class: string +} + +const p = Astro.props as Props; + +let external = false; + +if (p.href.includes('https://') || p.href.includes('http://')) { + external = true; +} + +--- + + + + {external ? ( + <> + \ No newline at end of file diff --git a/src/svg/FaExternalLink.svg b/src/svg/FaExternalLink.svg new file mode 100644 index 0000000..d00a268 --- /dev/null +++ b/src/svg/FaExternalLink.svg @@ -0,0 +1 @@ + \ No newline at end of file