Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ on:
- main
jobs:
build-and-deploy:
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: "14.x"
node-version: "24.x"
- run: yarn install
- run: yarn predeploy
- run: yarn lint
- run: yarn build
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Lint
on: push
jobs:
lint-only:
if: ${{ github.ref != 'refs/heads/main' }}
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: "24.x"
- run: yarn install
- run: yarn lint
3 changes: 3 additions & 0 deletions content-collections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,17 @@ const posts = defineCollection({
year: z.optional(z.number()),
stage: z.optional(z.string()),
codebattle: z.optional(z.boolean()),
bikoId: z.optional(z.number()),
content: z.string(),
}),
z.record(z.string(), z.union([z.string(), z.number(), z.boolean()])),
),
transform: async (post) => {
const { _meta, ...rest } = post;
const slug = `${_meta.directory}/${_meta.fileName.replace(/\.mdx$/, '')}`;
return {
...rest,
slug,
content: post.content.replace(
/\{meta\.([^}]+)\}/g,
(_: string, metaKey: string) => `{${JSON.stringify(Object.hasOwn(post, metaKey) ? post[metaKey] : '')}}`,
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
"dev": "vite dev --port 3000",
"build": "NODE_OPTIONS=--max-old-space-size=8192 vite build --mode production",
"start": "vite preview",
"lint": "tsc",
"predeploy": "yarn build"
"lint": "yarn build && tsc -b --noEmit"
},
"dependencies": {
"@emotion/react": "^11.14.0",
Expand Down
2 changes: 0 additions & 2 deletions src/components/Figure.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable @next/next/no-img-element */

import styled from "@emotion/styled";
import { type ReactNode } from "react";

Expand Down
25 changes: 6 additions & 19 deletions src/components/PostLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
/* eslint-disable @next/next/no-img-element */
import { Link } from "@tanstack/react-router";
import styled from "@emotion/styled";
import { Container, Divider, Footer, Space, Typo } from "@solved-ac/ui-react";
import { IconArrowLeft, IconArrowRight } from "@tabler/icons-react";
import { IconArrowLeft } from "@tabler/icons-react";
import { createLink } from "@tanstack/react-router";
import type { Post } from "content-collections";
import { createLink } from '@tanstack/react-router'

interface Meta {
title: string;
subtitle: string;
year: number;
stage: string;
codebattle?: boolean;
}

const NavigationContainer = styled.div`
padding-top: 32px;
Expand Down Expand Up @@ -52,12 +42,12 @@ const FooterLogo = styled.img`
height: 24px;
`;

type PostMeta = Omit<Post, '_meta' | 'content'>;
type PostMetaLike = Omit<Post, "_meta" | "content" | "slug">;

interface Props {
children: React.ReactNode;
root?: boolean;
meta?: PostMeta;
meta?: PostMetaLike;
theme?: {
background: string;
color: string;
Expand Down Expand Up @@ -112,10 +102,7 @@ export const PostLayout: React.FC<Props> = (props) => {
</MetaLinkA>
) : (
<MetaLink to={prev}>
<Navigation
description
style={theme && { color: theme.color }}
>
<Navigation description style={theme && { color: theme.color }}>
<IconArrowLeft /> 이전
</Navigation>
</MetaLink>
Expand All @@ -131,7 +118,7 @@ export const PostLayout: React.FC<Props> = (props) => {
{meta.year && (
<Typo description>
<MetaLink to={prev}>
NYPC {meta.codebattle ? "CODE BATTLE" : meta.year}
NYPC {meta.codebattle ? "CODE BATTLE" : meta.year}
</MetaLink>
{meta.stage && <> &middot; {meta.stage}</>}
</Typo>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const mapWithDepth = (depth: number): (child: RootContent | ElementConten
i: number
) => {
if (child.type === "doctype") return null;
// @ts-ignore - we know this is a valid content type
return mapChild(child, i, depth);
};

Expand Down
2 changes: 1 addition & 1 deletion src/components/languageExample/LanguageExample.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import styled from "@emotion/styled";
import { type PropsWithChildren } from "react";
import { LANGUAGE_EXAMPLES, type LANGUAGES } from "./examples";
import { HighlightedCode } from "components/hilightedCode/HighligtedCode";
import { HighlightedCode } from "@/components/highlightedCode/HighligtedCode";

const LanguageExampleContainer = styled.div`
display: flex;
Expand Down
2 changes: 1 addition & 1 deletion src/routes/$year.$page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const Route = createFileRoute('/$year/$page')({
}).parse,
},
loader: ({ params }) => {
const post = allPosts.find((p) => p._meta.directory === params.year && p._meta.fileName === `${params.page}.mdx`);
const post = allPosts.find((p) => p.slug === `${params.year}/${params.page}`);
if (!post) throw notFound();
return post;
},
Expand Down
2 changes: 1 addition & 1 deletion src/routes/$year.notice.$page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const Route = createFileRoute('/$year/notice/$page')({
}).parse,
},
loader: ({ params }) => {
const post = allPosts.find((p) => p._meta.directory === `${params.year}/notice` && p._meta.fileName === `${params.page}.mdx`);
const post = allPosts.find((p) => p.slug === `${params.year}/notice/${params.page}`);
if (!post) throw notFound();
return post;
},
Expand Down
4 changes: 2 additions & 2 deletions src/routes/2017/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ const List = () => {
<Typo h2>안내</Typo>
<Itemize>
<li>
<Link to="/2017/notice/rule">대회 규칙</Link>
<Link to="/$year/notice/$page" params={{ year, page: "rule" }}>대회 규칙</Link>
</li>
<li>
<Link to="/2017/notice/tool">개발 도구 사용 안내</Link>
<Link to="/$year/notice/$page" params={{ year, page: "tool" }}>개발 도구 사용 안내</Link>
</li>
</Itemize>
<Divider />
Expand Down
1 change: 1 addition & 0 deletions src/routes/2018/2018_final_1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: 뒤집기
year: 2018
stage: 본선
bikoId: 1684
---


Expand Down
1 change: 1 addition & 0 deletions src/routes/2018/2018_final_2.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: 세 수의 합
year: 2018
stage: 본선
bikoId: 1685
---


Expand Down
1 change: 1 addition & 0 deletions src/routes/2018/2018_final_3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: 레이저 클레이 사격
year: 2018
stage: 본선
bikoId: 1686
---


Expand Down
1 change: 1 addition & 0 deletions src/routes/2018/2018_final_4.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: 블록 게임
year: 2018
stage: 본선
bikoId: 1687
---


Expand Down
1 change: 1 addition & 0 deletions src/routes/2018/2018_final_5.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: 청소기 로봇
year: 2018
stage: 본선
bikoId: 1688
---


Expand Down
1 change: 1 addition & 0 deletions src/routes/2018/2018_final_6.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: 저상 버스 문
year: 2018
stage: 본선
bikoId: 1689
---


Expand Down
1 change: 1 addition & 0 deletions src/routes/2018/2018_final_7.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: 색종이
year: 2018
stage: 본선
bikoId: 1690
---


Expand Down
1 change: 1 addition & 0 deletions src/routes/2018/2018_final_8.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: 울타리
year: 2018
stage: 본선
bikoId: 1691
---


Expand Down
1 change: 1 addition & 0 deletions src/routes/2018/2018_online_10.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: 캐릭터 경험치
year: 2018
stage: 예선
bikoId: 1699
---


Expand Down
1 change: 1 addition & 0 deletions src/routes/2018/2018_online_11.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: 전염병 역학 조사
year: 2018
stage: 예선
bikoId: 1700
---


Expand Down
1 change: 1 addition & 0 deletions src/routes/2018/2018_online_12.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: 강력한 한방, 필살기
year: 2018
stage: 예선
bikoId: 1701
---


Expand Down
1 change: 1 addition & 0 deletions src/routes/2018/2018_online_13.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: 회전 격자판
year: 2018
stage: 예선
bikoId: 1702
---


Expand Down
1 change: 1 addition & 0 deletions src/routes/2018/2018_online_14.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: 블록숫자
year: 2018
stage: 예선
bikoId: 1703
---


Expand Down
1 change: 1 addition & 0 deletions src/routes/2018/2018_online_15.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: Flood-it
year: 2018
stage: 예선
bikoId: 1704
---


Expand Down
1 change: 1 addition & 0 deletions src/routes/2018/2018_online_16.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: 쉴드 생성기
year: 2018
stage: 예선
bikoId: 1705
---


Expand Down
1 change: 1 addition & 0 deletions src/routes/2018/2018_online_17.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: 퍼즐 콤보
year: 2018
stage: 예선
bikoId: 1706
---


Expand Down
1 change: 1 addition & 0 deletions src/routes/2018/2018_online_18.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: 피파 온라인 드리블 튜토리얼
year: 2018
stage: 예선
bikoId: 1707
---


Expand Down
1 change: 1 addition & 0 deletions src/routes/2018/2018_online_19.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: 종이접기
year: 2018
stage: 예선
bikoId: 1708
---


Expand Down
1 change: 1 addition & 0 deletions src/routes/2018/2018_online_20.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: 봇 탐지
year: 2018
stage: 예선
bikoId: 1709
---


Expand Down
1 change: 1 addition & 0 deletions src/routes/2018/2018_online_21.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: 금 줄 게임
year: 2018
stage: 예선
bikoId: 1710
---


Expand Down
1 change: 1 addition & 0 deletions src/routes/2018/2018_online_22.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: 보라색 영역
year: 2018
stage: 예선
bikoId: 1711
---


Expand Down
1 change: 1 addition & 0 deletions src/routes/2018/2018_online_3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: 아이템 구매
year: 2018
stage: 예선
bikoId: 1692
---


Expand Down
1 change: 1 addition & 0 deletions src/routes/2018/2018_online_4.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: 승리팀 찾기
year: 2018
stage: 예선
bikoId: 1693
---


Expand Down
1 change: 1 addition & 0 deletions src/routes/2018/2018_online_5.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: 줄임말
year: 2018
stage: 예선
bikoId: 1694
---


Expand Down
1 change: 1 addition & 0 deletions src/routes/2018/2018_online_6.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: 우물왕 김배찌
year: 2018
stage: 예선
bikoId: 1695
---


Expand Down
1 change: 1 addition & 0 deletions src/routes/2018/2018_online_7.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: 최고의 동접 구간을 찾아라!
year: 2018
stage: 예선
bikoId: 1696
---


Expand Down
1 change: 1 addition & 0 deletions src/routes/2018/2018_online_8.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: 버튼 게임
year: 2018
stage: 예선
bikoId: 1697
---


Expand Down
1 change: 1 addition & 0 deletions src/routes/2018/2018_online_9.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: 이진트리
year: 2018
stage: 예선
bikoId: 1698
---


Expand Down
Loading