disabled redundant korean project parsing
This commit is contained in:
parent
ea348aa531
commit
38f6e755f0
1 changed files with 31 additions and 30 deletions
|
@ -11,45 +11,46 @@ import { DataToPass } from "."
|
||||||
export default function parsePortfolio(data: DataToPass): void {
|
export default function parsePortfolio(data: DataToPass): void {
|
||||||
const { urlPath, markdownRaw, markdownData } = data
|
const { urlPath, markdownRaw, markdownData } = data
|
||||||
|
|
||||||
const lastPath = urlPath.slice(urlPath.lastIndexOf("/") + 1)
|
|
||||||
|
|
||||||
// check if the file is a portfolio overview or a project
|
// check if the file is a portfolio overview or a project
|
||||||
if (lastPath == "0") {
|
// explanation: file `0.md` is a special file (i.e. not a regular project file)
|
||||||
|
if (urlPath.slice(urlPath.lastIndexOf("/") + 1) == "0") {
|
||||||
portfolioData.overview = markdownData.content
|
portfolioData.overview = markdownData.content
|
||||||
} else {
|
} else {
|
||||||
if (markdownData.badges) {
|
if (!urlPath.endsWith(".kr")) {
|
||||||
;(markdownData.badges as string[]).forEach((slug) => {
|
if (markdownData.badges) {
|
||||||
// todo: handle cases when icon is not on simple-icons
|
;(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
|
// save svg icon
|
||||||
writeToFile(
|
writeToFile(
|
||||||
`${iconsDirectoryPath}/${icon.slug}.json`,
|
`${iconsDirectoryPath}/${icon.slug}.json`,
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
svg: icon.svg,
|
svg: icon.svg,
|
||||||
hex: color.toHexString(),
|
hex: color.toHexString(),
|
||||||
isDark: color.isDark(),
|
isDark: color.isDark(),
|
||||||
title: icon.title,
|
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
|
||||||
}
|
}
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
writeToFile(
|
writeToFile(
|
||||||
`${contentDirectoryPath}${urlPath}.json`,
|
`${contentDirectoryPath}${urlPath}.json`,
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue