Skip to content

Commit

Permalink
Kochie/feat/mastodon author (#772)
Browse files Browse the repository at this point in the history
* Adds mastodon author tag

* update tests

* update handle
  • Loading branch information
kochie authored Nov 3, 2024
1 parent 9ede221 commit 34ae853
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 10 deletions.
2 changes: 2 additions & 0 deletions metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ authors:
👋 I'm Robert, a Software Engineer from Melbourne, Australia. I
write about a bunch of different topics including technology, science,
business, and maths.
fediverse:
creator: '@[email protected]'
socialMedia:
- name: twitter
link: https://twitter.com/kochie
Expand Down
4 changes: 4 additions & 0 deletions src/app/articles/[articleId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { lqip } from '@/lib/shrink'
import { join } from 'path'
import { copyFile, mkdir, readdir, readFile } from 'fs/promises'
import { components } from '@/components/MDXWrapper/components'
import Head from 'next/head'

export async function generateMetadata({
params,
Expand Down Expand Up @@ -167,6 +168,9 @@ const ArticlePage = async ({ params }: { params: { articleId: string } }) => {

return (
<>
<Head>
<meta name="fediverse:creator" content={author.fediverse.creator} />
</Head>
<Article article={articleMetadata} author={author}>
<MDXContent components={components} />
</Article>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ exports[`FOOTER COMPONENT > renders correctly 1`] = `
>
<path
class="fa-secondary"
d="M0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zm128 0c0-32.8 12.5-65.5 37.5-90.5s57.8-37.5 90.5-37.5s65.5 12.5 90.5 37.5c4.7 4.7 7 10.8 7 17s-2.3 12.3-7 17c-9.4 9.4-24.6 9.4-34 0l-.4-.4c-31.3-30.8-81.6-30.7-112.7 .4c-31.2 31.2-31.2 81.9 0 113.1s81.9 31.2 113.1 0c9.4-9.4 24.6-9.4 33.9 0c4.7 4.7 7 10.8 7 17s-2.3 12.3-7 17c-25 25-57.8 37.5-90.5 37.5s-65.5-12.5-90.5-37.5s-37.5-57.8-37.5-90.5z"
d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM199.4 312.6c31.2 31.2 81.9 31.2 113.1 0c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9c-50 50-131 50-181 0s-50-131 0-181s131-50 181 0c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0c-31.2-31.2-81.9-31.2-113.1 0s-31.2 81.9 0 113.1z"
fill="currentColor"
/>
<path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ exports[`PAGE COMPONENT > renders correctly 1`] = `
>
<path
class="fa-secondary"
d="M0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zm128 0c0-32.8 12.5-65.5 37.5-90.5s57.8-37.5 90.5-37.5s65.5 12.5 90.5 37.5c4.7 4.7 7 10.8 7 17s-2.3 12.3-7 17c-9.4 9.4-24.6 9.4-34 0l-.4-.4c-31.3-30.8-81.6-30.7-112.7 .4c-31.2 31.2-31.2 81.9 0 113.1s81.9 31.2 113.1 0c9.4-9.4 24.6-9.4 33.9 0c4.7 4.7 7 10.8 7 17s-2.3 12.3-7 17c-25 25-57.8 37.5-90.5 37.5s-65.5-12.5-90.5-37.5s-37.5-57.8-37.5-90.5z"
d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM199.4 312.6c31.2 31.2 81.9 31.2 113.1 0c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9c-50 50-131 50-181 0s-50-131 0-181s131-50 181 0c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0c-31.2-31.2-81.9-31.2-113.1 0s-31.2 81.9 0 113.1z"
fill="currentColor"
/>
<path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ exports[`Quote Component > renders correctly 1`] = `
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M0 216C0 149.7 53.7 96 120 96l16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0c-39.8 0-72 32.2-72 72l0 10c5.1-1.3 10.5-2 16-2l64 0c35.3 0 64 28.7 64 64l0 64c0 35.3-28.7 64-64 64l-64 0c-35.3 0-64-28.7-64-64l0-32 0-32 0-72zm48 72l0 32 0 32c0 8.8 7.2 16 16 16l64 0c8.8 0 16-7.2 16-16l0-64c0-8.8-7.2-16-16-16l-64 0c-8.8 0-16 7.2-16 16zm336-16l-64 0c-8.8 0-16 7.2-16 16l0 32 0 32c0 8.8 7.2 16 16 16l64 0c8.8 0 16-7.2 16-16l0-64c0-8.8-7.2-16-16-16zM256 320l0-32 0-72c0-66.3 53.7-120 120-120l16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0c-39.8 0-72 32.2-72 72l0 10c5.1-1.3 10.5-2 16-2l64 0c35.3 0 64 28.7 64 64l0 64c0 35.3-28.7 64-64 64l-64 0c-35.3 0-64-28.7-64-64l0-32z"
d="M0 216C0 149.7 53.7 96 120 96h16c13.3 0 24 10.7 24 24s-10.7 24-24 24H120c-39.8 0-72 32.2-72 72v10c5.1-1.3 10.5-2 16-2h64c35.3 0 64 28.7 64 64v64c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V320 288 216zm48 72v32 32c0 8.8 7.2 16 16 16h64c8.8 0 16-7.2 16-16V288c0-8.8-7.2-16-16-16H64c-8.8 0-16 7.2-16 16zm336-16H320c-8.8 0-16 7.2-16 16v32 32c0 8.8 7.2 16 16 16h64c8.8 0 16-7.2 16-16V288c0-8.8-7.2-16-16-16zM256 320V288 216c0-66.3 53.7-120 120-120h16c13.3 0 24 10.7 24 24s-10.7 24-24 24H376c-39.8 0-72 32.2-72 72v10c5.1-1.3 10.5-2 16-2h64c35.3 0 64 28.7 64 64v64c0 35.3-28.7 64-64 64H320c-35.3 0-64-28.7-64-64V320z"
fill="currentColor"
/>
</svg>
Expand All @@ -39,7 +39,7 @@ exports[`Quote Component > renders correctly 1`] = `
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M448 296c0 66.3-53.7 120-120 120l-16 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l16 0c39.8 0 72-32.2 72-72l0-10c-5.1 1.3-10.5 2-16 2l-64 0c-35.3 0-64-28.7-64-64l0-64c0-35.3 28.7-64 64-64l64 0c35.3 0 64 28.7 64 64l0 32 0 32 0 72zm-48-72l0-32 0-32c0-8.8-7.2-16-16-16l-64 0c-8.8 0-16 7.2-16 16l0 64c0 8.8 7.2 16 16 16l64 0c8.8 0 16-7.2 16-16zM64 240l64 0c8.8 0 16-7.2 16-16l0-32 0-32c0-8.8-7.2-16-16-16l-64 0c-8.8 0-16 7.2-16 16l0 64c0 8.8 7.2 16 16 16zm128-48l0 32 0 72c0 66.3-53.7 120-120 120l-16 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l16 0c39.8 0 72-32.2 72-72l0-10c-5.1 1.3-10.5 2-16 2l-64 0c-35.3 0-64-28.7-64-64l0-64c0-35.3 28.7-64 64-64l64 0c35.3 0 64 28.7 64 64l0 32z"
d="M448 296c0 66.3-53.7 120-120 120H312c-13.3 0-24-10.7-24-24s10.7-24 24-24h16c39.8 0 72-32.2 72-72V286c-5.1 1.3-10.5 2-16 2H320c-35.3 0-64-28.7-64-64V160c0-35.3 28.7-64 64-64h64c35.3 0 64 28.7 64 64v32 32 72zm-48-72V192 160c0-8.8-7.2-16-16-16H320c-8.8 0-16 7.2-16 16v64c0 8.8 7.2 16 16 16h64c8.8 0 16-7.2 16-16zM64 240h64c8.8 0 16-7.2 16-16V192 160c0-8.8-7.2-16-16-16H64c-8.8 0-16 7.2-16 16v64c0 8.8 7.2 16 16 16zm128-48v32 72c0 66.3-53.7 120-120 120H56c-13.3 0-24-10.7-24-24s10.7-24 24-24H72c39.8 0 72-32.2 72-72V286c-5.1 1.3-10.5 2-16 2H64c-35.3 0-64-28.7-64-64V160c0-35.3 28.7-64 64-64h64c35.3 0 64 28.7 64 64v32z"
fill="currentColor"
/>
</svg>
Expand All @@ -54,7 +54,7 @@ exports[`Quote Component > renders correctly 1`] = `
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M0 256c0-13.3 10.7-24 24-24l272 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L24 280c-13.3 0-24-10.7-24-24z"
d="M0 256c0-13.3 10.7-24 24-24H296c13.3 0 24 10.7 24 24s-10.7 24-24 24H24c-13.3 0-24-10.7-24-24z"
fill="currentColor"
/>
</svg>
Expand Down
10 changes: 5 additions & 5 deletions src/components/Theme/__tests__/__snapshots__/Theme.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ exports[`THEME COMPONENT > should render 1`] = `
>
<path
class="fa-secondary"
d="M152.4 229.8c5.4 16.8 13.2 32.4 23 46.6c5 7.2 10.2 14.3 15.4 21.4c19.8 27.1 39.7 54.4 49.2 86.2l108.1 0L152.4 229.8zm8.5-129c17.5 13.7 35 27.4 52.4 41.1C227.7 96.7 270 64 320 64c8.8 0 16 7.2 16 16s-7.2 16-16 16c-40 0-73.1 29.3-79 67.6c65 50.9 129.9 101.8 194.9 152.8c4.4-6.2 8.9-12.4 13.4-18.6c5.2-7.1 10.4-14.2 15.4-21.4c19.8-28.5 31.4-63 31.4-100.3C496 78.8 417.2 0 320 0C249.7 0 189.1 41.2 160.8 100.8zM240 416l0 16c0 44.2 35.8 80 80 80s80-35.8 80-80l0-7.1L388.7 416 240 416z"
d="M435.9 316.3c4.4-6.2 8.9-12.4 13.4-18.6l0 0 0 0 0 0c5.2-7.1 10.4-14.2 15.4-21.4c19.8-28.5 31.4-63 31.4-100.3C496 78.8 417.2 0 320 0C249.7 0 189.1 41.2 160.8 100.8l52.4 41.1C227.7 96.7 270 64 320 64c8.8 0 16 7.2 16 16s-7.2 16-16 16c-40 0-73.1 29.3-79 67.6L435.9 316.3zM152.4 229.8c5.4 16.8 13.2 32.4 23 46.6c5 7.2 10.2 14.3 15.4 21.4l0 0c19.8 27.1 39.7 54.4 49.2 86.2H348.1L152.4 229.8zM240 416v16c0 44.2 35.8 80 80 80s80-35.8 80-80v-7.1L388.7 416H240z"
fill="currentColor"
/>
<path
Expand Down Expand Up @@ -104,7 +104,7 @@ exports[`THEME COMPONENT > should render 1`] = `
>
<path
class="fa-secondary"
d="M152.4 229.8c5.4 16.8 13.2 32.4 23 46.6c5 7.2 10.2 14.3 15.4 21.4c19.8 27.1 39.7 54.4 49.2 86.2l108.1 0L152.4 229.8zm8.5-129c17.5 13.7 35 27.4 52.4 41.1C227.7 96.7 270 64 320 64c8.8 0 16 7.2 16 16s-7.2 16-16 16c-40 0-73.1 29.3-79 67.6c65 50.9 129.9 101.8 194.9 152.8c4.4-6.2 8.9-12.4 13.4-18.6c5.2-7.1 10.4-14.2 15.4-21.4c19.8-28.5 31.4-63 31.4-100.3C496 78.8 417.2 0 320 0C249.7 0 189.1 41.2 160.8 100.8zM240 416l0 16c0 44.2 35.8 80 80 80s80-35.8 80-80l0-7.1L388.7 416 240 416z"
d="M435.9 316.3c4.4-6.2 8.9-12.4 13.4-18.6l0 0 0 0 0 0c5.2-7.1 10.4-14.2 15.4-21.4c19.8-28.5 31.4-63 31.4-100.3C496 78.8 417.2 0 320 0C249.7 0 189.1 41.2 160.8 100.8l52.4 41.1C227.7 96.7 270 64 320 64c8.8 0 16 7.2 16 16s-7.2 16-16 16c-40 0-73.1 29.3-79 67.6L435.9 316.3zM152.4 229.8c5.4 16.8 13.2 32.4 23 46.6c5 7.2 10.2 14.3 15.4 21.4l0 0c19.8 27.1 39.7 54.4 49.2 86.2H348.1L152.4 229.8zM240 416v16c0 44.2 35.8 80 80 80s80-35.8 80-80v-7.1L388.7 416H240z"
fill="currentColor"
/>
<path
Expand Down Expand Up @@ -153,12 +153,12 @@ exports[`THEME COMPONENT > should render 1`] = `
>
<path
class="fa-secondary"
d="M144 176c0 37.3 11.6 71.9 31.4 100.3c5 7.2 10.2 14.3 15.4 21.4c19.8 27.1 39.7 54.4 49.2 86.2l160 0c9.6-31.9 29.5-59.1 49.2-86.2c5.2-7.1 10.4-14.2 15.4-21.4c19.8-28.5 31.4-63 31.4-100.3C496 78.8 417.2 0 320 0S144 78.8 144 176zm64 0c0-61.9 50.1-112 112-112c8.8 0 16 7.2 16 16s-7.2 16-16 16c-44.2 0-80 35.8-80 80c0 8.8-7.2 16-16 16s-16-7.2-16-16z"
d="M449.2 297.8c-19.8 27.1-39.7 54.4-49.2 86.2H240c-9.6-31.9-29.5-59.1-49.2-86.2c-5.2-7.1-10.4-14.2-15.4-21.4C155.6 247.9 144 213.3 144 176C144 78.8 222.8 0 320 0s176 78.8 176 176c0 37.3-11.6 71.9-31.4 100.3c-5 7.2-10.2 14.3-15.4 21.4zM240 176c0-44.2 35.8-80 80-80c8.8 0 16-7.2 16-16s-7.2-16-16-16c-61.9 0-112 50.1-112 112c0 8.8 7.2 16 16 16s16-7.2 16-16z"
fill="currentColor"
/>
<path
class="fa-primary"
d="M69.3 4l48 32c11 7.4 14 22.3 6.7 33.3s-22.3 14-33.3 6.7l-48-32c-11-7.4-14-22.3-6.7-33.3S58.3-3.3 69.3 4zM597.3 44l-48 32c-11 7.4-25.9 4.4-33.3-6.7s-4.4-25.9 6.7-33.3l48-32c11-7.4 25.9-4.4 33.3 6.7s4.4 25.9-6.7 33.3zM24 160l64 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-64 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zm528 0l64 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-64 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zM117.3 332l-48 32c-11 7.4-25.9 4.4-33.3-6.7s-4.4-25.9 6.7-33.3l48-32c11-7.4 25.9-4.4 33.3 6.7s4.4 25.9-6.7 33.3zm432-39.9l48 32c11 7.4 14 22.3 6.7 33.3s-22.3 14-33.3 6.7l-48-32c-11-7.4-14-22.3-6.7-33.3s22.3-14 33.3-6.7zM400 432c0 44.2-35.8 80-80 80s-80-35.8-80-80l0-48 160 0 0 48z"
d="M69.3 4l48 32c11 7.4 14 22.3 6.7 33.3s-22.3 14-33.3 6.7l-48-32c-11-7.4-14-22.3-6.7-33.3S58.3-3.3 69.3 4zM597.3 44l-48 32c-11 7.4-25.9 4.4-33.3-6.7s-4.4-25.9 6.7-33.3l48-32c11-7.4 25.9-4.4 33.3 6.7s4.4 25.9-6.7 33.3zM24 160H88c13.3 0 24 10.7 24 24s-10.7 24-24 24H24c-13.3 0-24-10.7-24-24s10.7-24 24-24zm528 0h64c13.3 0 24 10.7 24 24s-10.7 24-24 24H552c-13.3 0-24-10.7-24-24s10.7-24 24-24zM117.3 332l-48 32c-11 7.4-25.9 4.4-33.3-6.7s-4.4-25.9 6.7-33.3l48-32c11-7.4 25.9-4.4 33.3 6.7s4.4 25.9-6.7 33.3zm432-39.9l48 32c11 7.4 14 22.3 6.7 33.3s-22.3 14-33.3 6.7l-48-32c-11-7.4-14-22.3-6.7-33.3s22.3-14 33.3-6.7zM400 432c0 44.2-35.8 80-80 80s-80-35.8-80-80V384H400v48z"
fill="currentColor"
/>
</g>
Expand Down Expand Up @@ -202,7 +202,7 @@ exports[`THEME COMPONENT > should render 1`] = `
>
<path
class="fa-secondary"
d="M296 352c0 6.9 .4 13.7 1.2 20.4c1.1 9.4 8.6 16.6 17.8 18.5l29.1 6.1c5 13.3 12.1 25.5 20.9 36.2l-9.3 28.2c-3 9-.5 19 7.1 24.7c4.7 3.5 9.5 6.8 14.6 9.8l5.4 3.1c5 2.8 10.2 5.3 15.5 7.6c2.6 1.1 5.3 1.6 8 1.6c6.3 0 12.5-2.9 16.9-7.8l19.8-22.2c6.8 1.1 13.8 1.7 20.9 1.7s14.1-.6 20.9-1.7l19.8 22.2c4.4 5 10.6 7.8 16.9 7.8c2.7 0 5.4-.5 8-1.6c5.3-2.3 10.5-4.8 15.5-7.6l5.4-3.1c5-3 9.9-6.3 14.6-9.8c7.6-5.7 10.1-15.7 7.1-24.7l-9.3-28.2c8.8-10.7 16-23 20.9-36.2l29.1-6.1c9.3-1.9 16.7-9.1 17.8-18.5c.8-6.7 1.2-13.5 1.2-20.4s-.4-13.7-1.2-20.4c-1.1-9.4-8.6-16.6-17.8-18.5L583.9 307c-5-13.3-12.1-25.5-20.9-36.2l9.3-28.2c3-9 .5-19-7.1-24.7c-4.7-3.5-9.6-6.8-14.6-9.9l-5.3-3c-5-2.8-10.2-5.3-15.6-7.6c-2.6-1.1-5.3-1.6-8-1.6c-6.3 0-12.5 2.9-16.9 7.8l-19.8 22.2c-6.8-1.1-13.8-1.7-20.9-1.7s-14.1 .6-20.9 1.7l-19.8-22.2c-4.4-4.9-10.6-7.8-16.9-7.8c-2.7 0-5.4 .5-8 1.6c-5.3 2.3-10.5 4.8-15.6 7.6l-5.2 3c-5.1 3-9.9 6.3-14.6 9.9c-7.6 5.7-10.1 15.7-7.1 24.7l9.3 28.2c-8.8 10.7-16 23-20.9 36.2L315.1 313c-9.3 1.9-16.7 9.1-17.8 18.5c-.8 6.7-1.2 13.5-1.2 20.4zm216 0a48 48 0 1 1 -96 0 48 48 0 1 1 96 0z"
d="M529.7 506.7c-8.7 3.7-18.6 .9-25-6.2l-19.8-22.2c-6.8 1.1-13.8 1.7-20.9 1.7s-14.1-.6-20.9-1.7l-19.8 22.2c-6.3 7.1-16.2 9.9-25 6.2c-5.3-2.3-10.5-4.8-15.5-7.6l-5.4-3.1c-5-3-9.9-6.3-14.6-9.8c-7.6-5.7-10.1-15.7-7.1-24.7l9.3-28.2c-8.8-10.7-16-23-20.9-36.2L315.1 391c-9.3-1.9-16.7-9.1-17.8-18.5c-.8-6.7-1.2-13.5-1.2-20.4s.4-13.7 1.2-20.4c1.1-9.4 8.6-16.6 17.8-18.5l29.1-6.1c5-13.3 12.1-25.5 20.9-36.2l-9.3-28.2c-3-9-.5-19 7.1-24.7c4.7-3.5 9.6-6.8 14.6-9.9l5.2-3c5-2.8 10.2-5.3 15.6-7.6c8.7-3.7 18.6-.9 25 6.2l19.8 22.2c6.8-1.1 13.8-1.7 20.9-1.7s14.1 .6 20.9 1.7l19.8-22.2c6.3-7.1 16.2-9.9 25-6.2c5.3 2.3 10.5 4.8 15.6 7.6l5.3 3c5.1 3 9.9 6.3 14.6 9.9c7.6 5.7 10.1 15.7 7.1 24.7l-9.3 28.2c8.8 10.7 16 23 20.9 36.2l29.1 6.1c9.3 1.9 16.7 9.1 17.8 18.5c.8 6.7 1.2 13.5 1.2 20.4s-.4 13.7-1.2 20.4c-1.1 9.4-8.6 16.6-17.8 18.5L583.9 397c-5 13.3-12.1 25.5-20.9 36.2l9.3 28.2c3 9 .5 19-7.1 24.7c-4.7 3.5-9.5 6.8-14.6 9.8l-5.4 3.1c-5 2.8-10.2 5.3-15.5 7.6zM416 352a48 48 0 1 0 96 0 48 48 0 1 0 -96 0z"
fill="currentColor"
/>
<path
Expand Down
3 changes: 3 additions & 0 deletions types/metadata.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ export interface Author {
lqip: string
}
bio: string
fediverse: {
creator: string
}
}

export interface Tag {
Expand Down

0 comments on commit 34ae853

Please sign in to comment.