diff --git a/src/pages/writeups/[ctf]/[year]/[category]/[name].astro b/src/pages/writeups/[ctf]/[year]/[category]/[name].astro index 9149b45..6dc724a 100644 --- a/src/pages/writeups/[ctf]/[year]/[category]/[name].astro +++ b/src/pages/writeups/[ctf]/[year]/[category]/[name].astro @@ -26,6 +26,15 @@ type Props = WriteUp; const writeup = Astro.props; const { Content } = await writeup.render(); + +const items = { + author: writeup.data.author, + category: writeup.category, + points: writeup.data.points, + solves: writeup.data.solves, +}; + +let maxWidth = Math.max(...Object.keys(items).map((key) => key.length)); --- @@ -54,27 +63,21 @@ const { Content } = await writeup.render();
- - - - - - - - - - - - - - - - - - - - -
Category{writeup.category}
Points{writeup.data.points}
Solves{writeup.data.solves}
Author{writeup.data.author}
+
+ { + Object.entries(items).map(([key, value]) => { + const padding = " ".repeat(maxWidth - key.length); + return ( +
+ {key} + + {" -> "} + {value} +
+ ); + }) + } +