Skip to content

Commit b10a3a2

Browse files
committed
feat: add warning alert for past festival pages
1 parent dac9f8a commit b10a3a2

File tree

4 files changed

+24
-3
lines changed

4 files changed

+24
-3
lines changed

โ€Žcontent/histories/6.mdxโ€Ž

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
---
2+
title: 2024 HUFS Code Festival
3+
archived: true
4+
---
5+
16
## ๋Œ€ํšŒ ๊ฐœ์š”
27

38
๋Œ€ํšŒ ํ™ˆํŽ˜์ด์ง€([https://codefestival.gdghufs.com](https://codefestival.gdghufs.com)) ํ†ตํ•ด ์ฐธ๊ฐ€ ์‹ ์ฒญ

โ€Žcontent/histories/7.mdxโ€Ž

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
<!-- ============================================ -->
1+
---
2+
title: 2025 HUFS Code Festival
3+
archived: false
4+
---
25

36
## ๊ฐœ์š”
47
---

โ€Žsrc/app/festival/[id]/page.css.tsโ€Ž

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ export const container = style({
1313
display: 'flex',
1414
});
1515

16+
export const alert = style({
17+
background: '#fff3cd',
18+
color: '#856404',
19+
padding: `${rem(12)} ${rem(16)}`,
20+
borderRadius: rem(8),
21+
fontSize: rem(14),
22+
});
23+
1624
export const article = style({
1725
width: '100%',
1826
maxWidth: '100%',

โ€Žsrc/app/festival/[id]/page.tsxโ€Ž

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default async function Page({ params }: PageProps) {
1818

1919
const filePath = path.join(process.cwd(), 'content/histories', `${id}.mdx`);
2020
const markdownWithMeta = fs.readFileSync(filePath, 'utf-8');
21-
const { content } = matter(markdownWithMeta);
21+
const { content, data } = matter(markdownWithMeta);
2222

2323
const toc: TOCType[] = [];
2424

@@ -47,7 +47,12 @@ export default async function Page({ params }: PageProps) {
4747
<Layout>
4848
<BackButton className={styles.backButton} />
4949
<div className={styles.container}>
50-
<article className={styles.article} dangerouslySetInnerHTML={{ __html: code }} />
50+
<article className={styles.article}>
51+
{data.archived === true && (
52+
<div className={styles.alert}>๐Ÿ•“ ์ด ํŽ˜์ด์ง€๋Š” ์ด์ „ ํ–‰์‚ฌ์˜ ์ •๋ณด๋ฅผ ๋‹ด๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.</div>
53+
)}
54+
<div dangerouslySetInnerHTML={{ __html: code }} />
55+
</article>
5156
<TableOfContents toc={toc} />
5257
</div>
5358
</Layout>

0 commit comments

Comments
ย (0)