diff --git a/generate/index.ts b/generate/index.ts index 5428948..cec006a 100644 --- a/generate/index.ts +++ b/generate/index.ts @@ -28,8 +28,6 @@ export const map: Map = { } export const seriesMap: SeriesMap = {} export const portfolioData: PortfolioData = { - overview_en: "", - overview_kr: "", skills: new Set(), projects: {}, } diff --git a/generate/recursiveParse/parsePortfolio.ts b/generate/recursiveParse/parsePortfolio.ts index f81cc4b..dbba325 100644 --- a/generate/recursiveParse/parsePortfolio.ts +++ b/generate/recursiveParse/parsePortfolio.ts @@ -2,63 +2,73 @@ import simpleIcons from "simple-icons" import tinycolor from "tinycolor2" import { contentDirectoryPath, iconsDirectoryPath } from "../config" -import { PortfolioProject } from "../../types/types" import { generateToc } from "../parseMarkdown" import { writeToFile } from "../util" import { portfolioData } from ".." import { DataToPass } from "." export default function parsePortfolio(data: DataToPass): void { - const { urlPath, markdownRaw, markdownData, path } = data + const { urlPath, markdownRaw, markdownData } = data - // check if the file is a portfolio overview or a project - // explanation: file `0.md` is a special file (i.e. not a regular project file) - if (path.endsWith("/0.md")) { - portfolioData.overview_en = markdownData.content - } else if (path.endsWith("/0.kr.md")) { - portfolioData.overview_kr = markdownData.content + if (urlPath.endsWith(".kr")) { + const contentID = urlPath.slice(0, urlPath.length - 3) + + if (portfolioData.projects[contentID]) { + portfolioData.projects[contentID] = { + ...portfolioData.projects[contentID], + overview_kr: markdownData.overview as string, + } + } else { + portfolioData.projects[contentID] = { + name: "", + image: "", + overview_en: "", + overview_kr: markdownData.overview as string, + badges: [], + repo: "", + } + } } else { - if (!urlPath.endsWith(".kr")) { - if (markdownData.badges) { - ;(markdownData.badges as string[]).forEach((slug) => { - // todo: handle cases when icon is not on simple-icons + if (markdownData.badges) { + ;(markdownData.badges as string[]).forEach((slug) => { + // todo: handle cases when icon is not on simple-icons - portfolioData.skills.add(slug) + portfolioData.skills.add(slug) - const icon = simpleIcons.Get(slug) + const icon = simpleIcons.Get(slug) - const color = tinycolor(icon.hex).lighten(5).desaturate(5) + const color = tinycolor(icon.hex).lighten(5).desaturate(5) - // save svg icon - writeToFile( - `${iconsDirectoryPath}/${icon.slug}.json`, - JSON.stringify({ - svg: icon.svg, - hex: color.toHexString(), - isDark: color.isDark(), - title: icon.title, - }) - ) - }) - } - - const project: PortfolioProject = { - name: markdownData.name as string, - image: markdownData.image as string, - overview: markdownData.overview as string, - badges: (markdownData.badges as string[]) || [], - repo: (markdownData.repo as string) || "", - } - - portfolioData.projects[urlPath] = project + // save svg icon + writeToFile( + `${iconsDirectoryPath}/${icon.slug}.json`, + JSON.stringify({ + svg: icon.svg, + hex: color.toHexString(), + isDark: color.isDark(), + title: icon.title, + }) + ) + }) } - writeToFile( - `${contentDirectoryPath}${urlPath}.json`, - JSON.stringify({ - content: markdownData.content, - toc: generateToc(markdownRaw), - }) - ) + portfolioData.projects[urlPath] = { + name: markdownData.name as string, + image: markdownData.image as string, + overview_en: markdownData.overview as string, + overview_kr: portfolioData.projects[urlPath] + ? portfolioData.projects[urlPath].overview_kr + : "", + badges: (markdownData.badges as string[]) || [], + repo: (markdownData.repo as string) || "", + } } + + writeToFile( + `${contentDirectoryPath}${urlPath}.json`, + JSON.stringify({ + content: markdownData.content, + toc: generateToc(markdownRaw), + }) + ) } diff --git a/markdown/portfolio/0.md b/markdown/portfolio/0.md deleted file mode 100644 index 88f37b8..0000000 --- a/markdown/portfolio/0.md +++ /dev/null @@ -1,3 +0,0 @@ ---- -github: https://github.com/developomp ---- diff --git a/markdown/portfolio/wbm.kr.md b/markdown/portfolio/wbm.kr.md new file mode 100644 index 0000000..011a7e7 --- /dev/null +++ b/markdown/portfolio/wbm.kr.md @@ -0,0 +1,29 @@ +--- +overview: 유니티 게임을 위한 모드. 인-게임 UI와 OBS 오버레이를 제공. +--- + +## 개요 + +War Brokers Mods, 줄여서 WBM은 게임 [War Brokers](https://warbrokers.io)를 위한 모드입니다. + +## 모드 + +C#으로 만들어졌으며, [BepInEx](https://github.com/BepInEx/BepInEx) 프레임워크를 사용하여 게임의 여러 측면을 패치합니다. + +## OBS 오버레이 + +
+
+
+
+