mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-04-26 06:45:23 -04:00
passing a custom link component to mdx was unnecessary
This commit is contained in:
parent
e6ead77f5f
commit
b51e8a38ce
@ -1,20 +0,0 @@
|
||||
import Link from "next/link";
|
||||
import type { LinkProps } from "next/link";
|
||||
|
||||
type CustomLinkProps = LinkProps & {
|
||||
target?: string;
|
||||
rel?: string;
|
||||
className?: string;
|
||||
children?: unknown;
|
||||
rest?: unknown;
|
||||
};
|
||||
|
||||
const CustomLink = ({ href, target, rel, className, children, ...rest }: CustomLinkProps) => (
|
||||
<Link href={href} passHref={true}>
|
||||
<a className={className} target={target} rel={rel} {...rest}>
|
||||
{children}
|
||||
</a>
|
||||
</Link>
|
||||
);
|
||||
|
||||
export default CustomLink;
|
@ -11,8 +11,8 @@ tags:
|
||||
image: "/static/images/notes/bernie-sanders-bern-app-data/sad-bernie.jpg"
|
||||
---
|
||||
|
||||
import Image from "./components/embeds/Image";
|
||||
import Video from "./components/embeds/Video";
|
||||
import Image from "./components/media/Image";
|
||||
import Video from "./components/media/Video";
|
||||
|
||||
The team behind Bernie Sanders' 2020 campaign [released a new web app](https://www.nbcnews.com/politics/2020-election/bernie-sanders-2020-campaign-unveils-app-increase-its-voter-database-n999206) last month named [BERN](https://app.berniesanders.com/). The goal of BERN is simple: to gather as much information as they can on as many voters in the United States as they can, and make their grassroots army of enthusiastic supporters do the work. It's undoubtedly a smart strategy, but also a concerning one for myself and other privacy advocates.
|
||||
|
||||
|
@ -11,8 +11,8 @@ tags:
|
||||
image: "/static/images/notes/cloudflare-dns-archive-is-blocked/archive-is.png"
|
||||
---
|
||||
|
||||
import Image from "./components/embeds/Image";
|
||||
import Tweet from "./components/embeds/Tweet";
|
||||
import Image from "./components/media/Image";
|
||||
import Tweet from "./components/media/Tweet";
|
||||
|
||||
**tl;dr:** No. Quite the opposite, actually — [Archive.is](https://archive.is/)'s owner is intentionally blocking 1.1.1.1 users.
|
||||
|
||||
|
@ -12,7 +12,7 @@ tags:
|
||||
image: "/static/images/notes/cool-bash-tricks-for-your-terminal-dotfiles/terminal.png"
|
||||
---
|
||||
|
||||
import Image from "./components/embeds/Image";
|
||||
import Image from "./components/media/Image";
|
||||
|
||||
<Image
|
||||
src="/static/images/notes/cool-bash-tricks-for-your-terminal-dotfiles/terminal.png"
|
||||
|
@ -11,8 +11,8 @@ tags:
|
||||
image: "/static/images/notes/coronavirus-open-source/covid19dashboards.png"
|
||||
---
|
||||
|
||||
import Image from "./components/embeds/Image";
|
||||
import Video from "./components/embeds/Video";
|
||||
import Image from "./components/media/Image";
|
||||
import Video from "./components/media/Video";
|
||||
|
||||
export const Octocat = (props) => {
|
||||
return (
|
||||
|
@ -11,9 +11,9 @@ tags:
|
||||
image: "/static/images/notes/dropping-dropbox/email.png"
|
||||
---
|
||||
|
||||
import Image from "./components/embeds/Image";
|
||||
import Tweet from "./components/embeds/Tweet";
|
||||
import Video from "./components/embeds/Video";
|
||||
import Image from "./components/media/Image";
|
||||
import Tweet from "./components/media/Tweet";
|
||||
import Video from "./components/media/Video";
|
||||
|
||||
I've been a loyal Dropbox user since its inception as a [Y Combinator startup](https://www.ycombinator.com/apply/dropbox/) ten years ago. Having a folder on all of my devices that instantly synchronized with each other was a game-changer for me, and I grew dependent on it more and more as they gave out free storage like candy — 48 GB for having a Samsung Chromebook, 1 GB for "Posting \<3 to Twitter," and so on — until I needed to upgrade to Dropbox Pro. But this month I canceled my Pro subscription after a few too many strikes.
|
||||
|
||||
|
@ -11,7 +11,7 @@ tags:
|
||||
image: "/static/images/notes/finding-candidates-subdomain-takeovers/hackerone-2.png"
|
||||
---
|
||||
|
||||
import Image from "./components/embeds/Image";
|
||||
import Image from "./components/media/Image";
|
||||
|
||||
A **subdomain takeover** occurs when a subdomain (like _example_.jarv.is) points to a shared hosting account that is abandoned by its owner, leaving the endpoint available to claim for yourself.
|
||||
|
||||
|
@ -11,8 +11,8 @@ tags:
|
||||
image: "/static/images/notes/github-actions/actions-flow.png"
|
||||
---
|
||||
|
||||
import Image from "./components/embeds/Image";
|
||||
import Gist from "./components/embeds/Gist";
|
||||
import Image from "./components/media/Image";
|
||||
import Gist from "./components/media/Gist";
|
||||
|
||||
<Image
|
||||
src="/static/images/notes/github-actions/actions-flow.png"
|
||||
|
@ -12,8 +12,8 @@ tags:
|
||||
image: "/static/images/notes/github-rename-master/github-default.png"
|
||||
---
|
||||
|
||||
import Image from "./components/embeds/Image";
|
||||
import Tweet from "./components/embeds/Tweet";
|
||||
import Image from "./components/media/Image";
|
||||
import Tweet from "./components/media/Tweet";
|
||||
|
||||
<Image
|
||||
src="/static/images/notes/github-rename-master/blm-topic.png"
|
||||
|
@ -12,8 +12,8 @@ tags:
|
||||
image: "/static/images/notes/how-to-backup-linux-server/apocalypse.png"
|
||||
---
|
||||
|
||||
import Image from "./components/embeds/Image";
|
||||
import Tweet from "./components/embeds/Tweet";
|
||||
import Image from "./components/media/Image";
|
||||
import Tweet from "./components/media/Tweet";
|
||||
|
||||
<figure>
|
||||
<Image
|
||||
|
@ -12,7 +12,7 @@ tags:
|
||||
image: "/static/images/notes/how-to-pull-request-fork-github/step7-2.png"
|
||||
---
|
||||
|
||||
import Image from "./components/embeds/Image";
|
||||
import Image from "./components/media/Image";
|
||||
|
||||
<svg width="150" height="150" viewBox="0 0 40 40" style={{ float: "right", marginBottom: "6px", marginLeft: "12px" }}>
|
||||
<path d="M6.5 35v-4.8c0-5.4 4.3-9.7 9.7-9.7h7.6c5.4 0 9.7-4.3 9.7-9.7V6M6.5 32.5v-26" fill="none" stroke="#a3b7cc" />
|
||||
|
@ -11,7 +11,7 @@ tags:
|
||||
image: "/static/images/notes/how-to-shrink-linux-virtual-disk-vmware/screen-shot-2018-12-07-at-2-04-04-pm.png"
|
||||
---
|
||||
|
||||
import Image from "./components/embeds/Image";
|
||||
import Image from "./components/media/Image";
|
||||
|
||||
<figure>
|
||||
<Image
|
||||
|
@ -11,8 +11,8 @@ image: "/static/images/notes/millenial-with-hillary-clinton/24707394571_0818d4ab
|
||||
noComments: true
|
||||
---
|
||||
|
||||
import Image from "./components/embeds/Image";
|
||||
import Video from "./components/embeds/Video";
|
||||
import Image from "./components/media/Image";
|
||||
import Video from "./components/media/Video";
|
||||
|
||||
{/* prettier-ignore */}
|
||||
<figure>
|
||||
|
@ -11,7 +11,7 @@ tags:
|
||||
image: "/static/images/notes/my-first-code/jbb-screen1.png"
|
||||
---
|
||||
|
||||
import Image from "./components/embeds/Image";
|
||||
import Image from "./components/media/Image";
|
||||
|
||||
<Image
|
||||
src="/static/images/notes/my-first-code/netscape.png"
|
||||
|
@ -12,7 +12,7 @@ tags:
|
||||
image: "/static/images/notes/netlify-analytics-review/overview.png"
|
||||
---
|
||||
|
||||
import Image from "./components/embeds/Image";
|
||||
import Image from "./components/media/Image";
|
||||
|
||||
I've been trying out [Netlify Analytics](https://www.netlify.com/products/analytics/) on this site for over a month now and have some quick thoughts about this unique offering in a world full of bloated and invasive tracking scripts.
|
||||
|
||||
|
@ -12,7 +12,7 @@ image: "/static/images/notes/no-homo-still-raps-motto/1_b41ztscbaxqi60snwsswfw.j
|
||||
noComments: true
|
||||
---
|
||||
|
||||
import Image from "./components/embeds/Image";
|
||||
import Image from "./components/media/Image";
|
||||
|
||||
{/* prettier-ignore */}
|
||||
<figure>
|
||||
|
@ -10,8 +10,8 @@ tags:
|
||||
image: "/static/images/notes/presidential-candidates-404-pages/obama-laughing.jpg"
|
||||
---
|
||||
|
||||
import Image from "./components/embeds/Image";
|
||||
import Video from "./components/embeds/Video";
|
||||
import Image from "./components/media/Image";
|
||||
import Video from "./components/media/Video";
|
||||
|
||||
<figure>
|
||||
<Image
|
||||
|
@ -11,7 +11,7 @@ tags:
|
||||
image: "/static/images/notes/security-headers-cloudflare-workers/security-headers.png"
|
||||
---
|
||||
|
||||
import Image from "./components/embeds/Image";
|
||||
import Image from "./components/media/Image";
|
||||
|
||||
{/* prettier-ignore */}
|
||||
<figure>
|
||||
|
@ -11,7 +11,7 @@ tags:
|
||||
image: "/static/images/notes/shodan-search-queries/shodan.png"
|
||||
---
|
||||
|
||||
import Image from "./components/embeds/Image";
|
||||
import Image from "./components/media/Image";
|
||||
|
||||
Over time, I've collected an assortment of interesting, funny, and depressing search queries to plug into [Shodan](https://www.shodan.io/), the ([literal](https://www.vice.com/en_uk/article/9bvxmd/shodan-exposes-the-dark-side-of-the-net)) internet search engine. Some return facepalm-inducing results, while others return serious and/or ancient vulnerabilities in the wild.
|
||||
|
||||
|
@ -10,7 +10,7 @@ tags:
|
||||
image: "/static/images/notes/y2k-sandbox/screenshot.png"
|
||||
---
|
||||
|
||||
import Image from "./components/embeds/Image";
|
||||
import Image from "./components/media/Image";
|
||||
|
||||
A few months ago, I stumbled upon [my first website ever](https://jakejarvis.github.io/my-first-website/) on an old floppy disk. Despite the instant cringing, I [uploaded it](https://github.com/jakejarvis/my-first-website) to GitHub, [collected other iterations](/previously/), and made an [#awesome-list](https://github.com/jakejarvis/awesome-first-code) of others who were brave and/or shameless enough to do the same. But why not take that ~~one~~ 1,000 steps further?
|
||||
|
||||
|
@ -1,31 +0,0 @@
|
||||
import { NextSeo } from "next-seo";
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
|
||||
import angryPandaGif from "../public/static/images/angry-panda.gif";
|
||||
|
||||
const Custom404 = () => (
|
||||
<>
|
||||
<NextSeo title="Page Not Found" noindex={true} nofollow={true} />
|
||||
|
||||
<div>
|
||||
<Image src={angryPandaGif} width="435" height="300" alt="Panda takes out anger on innocent computer." />
|
||||
|
||||
<h2>404s Make Panda Angry</h2>
|
||||
|
||||
<Link href="/">
|
||||
<a>Maybe it's wise to get out of here and go home...?</a>
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
<style jsx>{`
|
||||
div {
|
||||
padding: 2em 0;
|
||||
text-align: center;
|
||||
line-height: 1.5;
|
||||
}
|
||||
`}</style>
|
||||
</>
|
||||
);
|
||||
|
||||
export default Custom404;
|
@ -1,7 +1,7 @@
|
||||
import { NextSeo } from "next-seo";
|
||||
import Content from "../components/Content";
|
||||
import PageTitle from "../components/page/PageTitle";
|
||||
import Video from "../components/embeds/Video";
|
||||
import Video from "../components/media/Video";
|
||||
import { TapeIcon } from "../components/icons";
|
||||
|
||||
import thumbnail from "../public/static/images/birthday/thumb.png";
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { NextSeo } from "next-seo";
|
||||
import Content from "../components/Content";
|
||||
import PageTitle from "../components/page/PageTitle";
|
||||
import Video from "../components/embeds/Video";
|
||||
import Video from "../components/media/Video";
|
||||
|
||||
import thumbnail from "../public/static/images/hillary/thumb.png";
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { NextSeo } from "next-seo";
|
||||
import Content from "../components/Content";
|
||||
import PageTitle from "../components/page/PageTitle";
|
||||
import Video from "../components/embeds/Video";
|
||||
import Video from "../components/media/Video";
|
||||
|
||||
import thumbnail from "../public/static/images/leo/thumb.png";
|
||||
|
||||
|
@ -6,8 +6,7 @@ import { escape } from "html-escaper";
|
||||
import { getMDXComponent } from "mdx-bundler/client";
|
||||
import Content from "../../components/Content";
|
||||
import Meta from "../../components/notes/Meta";
|
||||
import CustomLink from "../../components/embeds/Link";
|
||||
import CustomCode from "../../components/embeds/Code";
|
||||
import CustomCode from "../../components/media/Code";
|
||||
import { getNote, getNoteSlugs } from "../../lib/parse-notes";
|
||||
import * as config from "../../lib/config";
|
||||
import type { GetStaticProps, GetStaticPaths } from "next";
|
||||
@ -16,11 +15,6 @@ import type { NoteType } from "../../types";
|
||||
const Comments = dynamic(() => import("../../components/notes/Comments"), { ssr: false });
|
||||
|
||||
const Note = ({ frontMatter, mdxSource }: NoteType) => {
|
||||
const customComponents = {
|
||||
a: CustomLink,
|
||||
code: CustomCode,
|
||||
};
|
||||
|
||||
const MDXComponent = useMemo(() => getMDXComponent(mdxSource, { process }), [mdxSource]);
|
||||
|
||||
return (
|
||||
@ -73,8 +67,7 @@ const Note = ({ frontMatter, mdxSource }: NoteType) => {
|
||||
|
||||
<Meta {...frontMatter} />
|
||||
<Content>
|
||||
{/* @ts-ignore */}
|
||||
<MDXComponent components={customComponents} />
|
||||
<MDXComponent components={{ code: CustomCode }} />
|
||||
</Content>
|
||||
{frontMatter.noComments !== true && <Comments slug={frontMatter.slug} />}
|
||||
</>
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 400 KiB |
Loading…
x
Reference in New Issue
Block a user