From bb6d6e6e5108033194a0abc092c094abae0fe85c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=A3=A8=EB=B0=80LuMir?= Date: Wed, 16 Oct 2024 16:46:29 +0900 Subject: [PATCH 1/5] refactor: detatch markdownToJsx and markdownToJsxFromPath in utils/markup.js --- src/app/posts/[markdown]/page.jsx | 4 ++-- src/utils/markup.js | 20 ++++++++++++++++---- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/app/posts/[markdown]/page.jsx b/src/app/posts/[markdown]/page.jsx index a14f0d0..19db1e4 100644 --- a/src/app/posts/[markdown]/page.jsx +++ b/src/app/posts/[markdown]/page.jsx @@ -2,7 +2,7 @@ import { join } from 'path'; import { PATH_DOCS, EXT_MD, EXT_MD_REGEXP } from '@/constants'; import { readMarkdownFile, readMarkdownFilesFromDir } from '@/utils/fs'; -import { markdownToText, markdownToJsx } from '@/utils/markup'; +import { markdownToText, markdownToJsxFromPath } from '@/utils/markup'; /* Custom Declaration */ function getFilePath(params) { @@ -34,5 +34,5 @@ export async function generateMetadata({ params }) { } export default async function Page({ params }) { - return <>{await markdownToJsx(getFilePath(params))}; + return <>{await markdownToJsxFromPath(getFilePath(params))}; } diff --git a/src/utils/markup.js b/src/utils/markup.js index 20195e9..92c268d 100644 --- a/src/utils/markup.js +++ b/src/utils/markup.js @@ -48,19 +48,31 @@ export async function markdownToHtml(markdownContent) { * Converts markdown content to JSX. * * @async + * @param {string} markdownContent Markdown content. + * @returns {Promise} A promise that resolves to JSX. + */ +export async function markdownToJsx(markdownContent) { + const html = await markdownToHtml(markdownContent); + const jsx = htmlToJsx(html); + + return jsx; +} + +/** + * Converts markdown content to JSX from path. + * + * @async * @param {string} pathToMarkdownFile Path to a markdown file. * @returns {Promise} A promise that resolves to JSX. */ -export async function markdownToJsx(pathToMarkdownFile) { +export async function markdownToJsxFromPath(pathToMarkdownFile) { const { content, data: { title }, } = await readMarkdownFile(pathToMarkdownFile); const markdownContent = writeTitleIntoMarkdown(title, content); - - const html = await markdownToHtml(markdownContent); - const jsx = htmlToJsx(html); + const jsx = await markdownToJsx(markdownContent); return jsx; } From a079abbd6710b14fc67655ee08f0d85e1a626306 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=A3=A8=EB=B0=80LuMir?= Date: Wed, 16 Oct 2024 16:48:14 +0900 Subject: [PATCH 2/5] refactor: use markdownToJsx instead of markdownToText in categories/[tag]/page.jsx Additionally, I added Authorization key in markdownToHtml for more API requests --- src/app/categories/[tag]/page.jsx | 6 +++--- src/utils/markup.js | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app/categories/[tag]/page.jsx b/src/app/categories/[tag]/page.jsx index 17b948d..442336a 100644 --- a/src/app/categories/[tag]/page.jsx +++ b/src/app/categories/[tag]/page.jsx @@ -6,7 +6,7 @@ import { FaBook, FaTag, FaRegCalendarPlus, FaRegCalendarXmark } from 'react-icon import { PATH_DOCS, EXT_MD_REGEXP } from '@/constants'; import { compareMarkdownDocument } from '@/utils/compare'; import { readMarkdownTagTree } from '@/utils/fs'; -import { markdownToText } from '@/utils/markup'; +import { markdownToJsx } from '@/utils/markup'; export default async function Page({ params, searchParams }) { const { sort = 'updated', order = 'desc' } = searchParams; @@ -21,12 +21,12 @@ export default async function Page({ params, searchParams }) {

- {markdownToText(title)} + {markdownToJsx(title)}

- {markdownToText(description)} + {markdownToJsx(description)}

{tags.map(tag => ( diff --git a/src/utils/markup.js b/src/utils/markup.js index 92c268d..0e44080 100644 --- a/src/utils/markup.js +++ b/src/utils/markup.js @@ -31,6 +31,7 @@ export async function markdownToHtml(markdownContent) { method: 'POST', headers: { Accept: 'application/vnd.github+json', + Authorization: process.env.GH_PAT, 'Content-Type': 'application/json', 'X-GitHub-Api-Version': '2022-11-28', }, From f9d837f686c4d1a5f090541f1d08af44667c59de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=A3=A8=EB=B0=80LuMir?= Date: Wed, 16 Oct 2024 17:00:42 +0900 Subject: [PATCH 3/5] feat: make [tag]/page.jsx use generateStaticParams --- src/app/categories/[tag]/page.jsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/app/categories/[tag]/page.jsx b/src/app/categories/[tag]/page.jsx index 442336a..92c7bfc 100644 --- a/src/app/categories/[tag]/page.jsx +++ b/src/app/categories/[tag]/page.jsx @@ -8,9 +8,19 @@ import { compareMarkdownDocument } from '@/utils/compare'; import { readMarkdownTagTree } from '@/utils/fs'; import { markdownToJsx } from '@/utils/markup'; +/* Next.js Declaration */ +// Control what happens when a dynamic segment is visited that was not generated with `generateStaticParams`. +export const dynamicParams = false; + +export async function generateStaticParams() { + const tagTree = await readMarkdownTagTree(PATH_DOCS); + const tags = Object.keys(tagTree); + + return tags.map(tag => ({ tag })); +} + export default async function Page({ params, searchParams }) { const { sort = 'updated', order = 'desc' } = searchParams; - const tagTree = await readMarkdownTagTree(PATH_DOCS); return ( From a386658edac397ef31acb7abb929f99bda3c538a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=A3=A8=EB=B0=80LuMir?= Date: Wed, 16 Oct 2024 21:21:11 +0900 Subject: [PATCH 4/5] fix: update invalid Authorization headers in markdownToHtml --- src/utils/markup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/markup.js b/src/utils/markup.js index 0e44080..56aed63 100644 --- a/src/utils/markup.js +++ b/src/utils/markup.js @@ -31,7 +31,7 @@ export async function markdownToHtml(markdownContent) { method: 'POST', headers: { Accept: 'application/vnd.github+json', - Authorization: process.env.GH_PAT, + Authorization: `Bearer ${process.env.GH_PAT}`, 'Content-Type': 'application/json', 'X-GitHub-Api-Version': '2022-11-28', }, From 44a58f28488c399da03e25e0cb0bda5a6bae01aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=A3=A8=EB=B0=80LuMir?= Date: Wed, 16 Oct 2024 21:35:51 +0900 Subject: [PATCH 5/5] feat: create Loading component and apply it to routes --- public/images/loading.gif | Bin 0 -> 18278 bytes src/app/categories/[tag]/page.jsx | 4 +++- src/app/posts/[markdown]/loading.jsx | 5 +++++ src/components/common/Loading/Loading.jsx | 19 ++++++++++++++++++ .../common/Loading/Loading.module.scss | 3 +++ src/components/common/Loading/index.js | 3 +++ 6 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 public/images/loading.gif create mode 100644 src/app/posts/[markdown]/loading.jsx create mode 100644 src/components/common/Loading/Loading.jsx create mode 100644 src/components/common/Loading/Loading.module.scss create mode 100644 src/components/common/Loading/index.js diff --git a/public/images/loading.gif b/public/images/loading.gif new file mode 100644 index 0000000000000000000000000000000000000000..e022aab0f78a8229c2f62acdd47864b73cc530f7 GIT binary patch literal 18278 zcmeI3Ra9KvmhZ6$9tc5$ySo(b1P|^`;qIQ`!QI{6gS)#s1r+YCLF@9JKBsSwar^eY zPd)nKtC!k)?PYV>{*C{fTS8Kt3t;dQ`X_V@4AkS(v#6{p1OkDAf+B_>%84l}i3oic zV_{%|h5olBb=mJkq6SU|Z~wdkZgvJnmOv*WL!ha-4IjyQYbObjxiKG!8oMl$teptZ z%>0{&15n9BPT9!A(g&ES7ZD$R1G9YrZwz6^LcH<*4Ft#-Wa=%^wmCQ&& z^p7k~mV6{ae?1`jt4$GG2OtqU0|&hkGaEY*CxC&OgOv>cpd(^oV&-CG;$mcGrDx{g zW@F-JVIlhGkL0a22V)a%MN#p8w)J+$M`GsWWXH|O=<4dq;L6Hi>tM>r3;+NanOGQE zSm@t!&^x-@I2pLn+c=W`s|Hb^qmhHTos+q(4bfjU8W`F-JModc_4MCNu(p$x{r8G( z92x#$5QCAeHKUt>9V0UX6Qi~DUv~W?x1*CH@PBvXKh5o^>~05SR0KNOIy)Ev-?Eeb ztMJ>{{nrismGP}N-0}|QZI-Bv(U2{u&}bSursq88nXSXp8u>oix`Ix0Kg&6%qqsp%q%9t1rQe%7Gq@+ z<75#M7ZzvvS6N9LM<)XtBjCT1-4P*gu8n81N z)3Y(Na?t}#*f{77I5;`z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<9-&oUtyN%8F<^tBy8*U6#OUKgvVS%^z;ld%wJbXZI|k#?(AaIWVS|x0VA;) zS0S91z%NFCQTn%tJA?3LMt_YFLyn=i(R3rmyk=rk-MZ-c6O;2Uz=T+3Z4lb(F1;T1 zq*23l=Cb7;fD?O)1JeoO`@n0&r-VK2tI8IDqhlt4n%eE{V--xCVIoPGI+cQQodFm( z5&3{Uo3n6JEHrMUbe}X=a(9zOonfZNh&ykqTK^MgN=H>N$0x+r%m(B~HgE?rym$lA|ta+_GNPbGiDCvDOpW+J@0&3B1tY+$U@0h?lss z&u~{?Bx|GB+6rovqib#Sx7j4qs=AjGtOT!_I6r|_Zd|G=kTcIdOY&^oSvQ7ac5L*Q ziu72DS@qD$+Fx04tZGg)DG7z0M|ytkzymi7NmN3IDBIWEBOQj4`(sdav%-d%B*tmnN&7VNod&3~V6xq9ZR*3xC~a~BF} zKeyxz@4cpT>G({r5m@EC^`XVt*yGfVuJoNuRKVz)wxUGtM SIkEilw0iFI^)1AW=YIjtf<%1) literal 0 HcmV?d00001 diff --git a/src/app/categories/[tag]/page.jsx b/src/app/categories/[tag]/page.jsx index 92c7bfc..0638b3d 100644 --- a/src/app/categories/[tag]/page.jsx +++ b/src/app/categories/[tag]/page.jsx @@ -3,6 +3,8 @@ import Link from 'next/link'; import { Fragment, Suspense } from 'react'; import { FaBook, FaTag, FaRegCalendarPlus, FaRegCalendarXmark } from 'react-icons/fa6'; +import Loading from '@/components/common/Loading'; + import { PATH_DOCS, EXT_MD_REGEXP } from '@/constants'; import { compareMarkdownDocument } from '@/utils/compare'; import { readMarkdownTagTree } from '@/utils/fs'; @@ -24,7 +26,7 @@ export default async function Page({ params, searchParams }) { const tagTree = await readMarkdownTagTree(PATH_DOCS); return ( - loading...}> + }> {tagTree[params.tag] .sort(compareMarkdownDocument(sort, order)) .map(({ basename, data: { title, description, created, updated, tags } }) => ( diff --git a/src/app/posts/[markdown]/loading.jsx b/src/app/posts/[markdown]/loading.jsx new file mode 100644 index 0000000..d696d1b --- /dev/null +++ b/src/app/posts/[markdown]/loading.jsx @@ -0,0 +1,5 @@ +import LoadingGif from '@/components/common/Loading'; + +export default function Loading() { + return ; +} diff --git a/src/components/common/Loading/Loading.jsx b/src/components/common/Loading/Loading.jsx new file mode 100644 index 0000000..b1fb416 --- /dev/null +++ b/src/components/common/Loading/Loading.jsx @@ -0,0 +1,19 @@ +import Image from 'next/image'; + +import styles from './Loading.module.scss'; + +export default function Loading({ content }) { + return ( +

+
+ GitHub gif loading image +
{content} 불러오는 중...
+
+
+ ); +} diff --git a/src/components/common/Loading/Loading.module.scss b/src/components/common/Loading/Loading.module.scss new file mode 100644 index 0000000..2016751 --- /dev/null +++ b/src/components/common/Loading/Loading.module.scss @@ -0,0 +1,3 @@ +.loading { + @include props-flex-center; +} diff --git a/src/components/common/Loading/index.js b/src/components/common/Loading/index.js new file mode 100644 index 0000000..a57e397 --- /dev/null +++ b/src/components/common/Loading/index.js @@ -0,0 +1,3 @@ +import Loading from './Loading'; + +export default Loading;