refactor(content): remove unsearchable content

This commit is contained in:
Kim, Jimin 2023-07-09 11:17:00 +09:00
parent af35b116a0
commit 335c23ad9c
6 changed files with 1 additions and 84 deletions

View file

@ -1,34 +0,0 @@
---
title: Resume
---
## Jimin Kim
[![Github](https://img.shields.io/badge/github-black?style=for-the-badge&logo=github)](https://github.com/developomp)
[![Portfolio](https://img.shields.io/badge/portfolio-grey?style=for-the-badge)](https://portfolio.developomp.com)
Frontend engineer wannabe
A natural-born developer who has got to create everything with his own hand.
He won't be satisfied until he breaks everything down to its components and understands what's behind it.
Characteristics:
- daily drives [arch linux](https://archlinux.org)
- can fluently speak, read, and write English and Korean at a native level
Email: developomp@gmail.com
## Education
### [Hongik university](https://wwwce.hongik.ac.kr) computer science major
- Mar 2022 - now
## Github
<img alt="github metrics" src="https://raw.githubusercontent.com/developomp/developomp/master/github-metrics.svg" style="display: block; margin-left: auto; margin-right: auto; max-width: 100%;">
## Skills
<img alt="programming skills" src="/img/skills.svg" style="display: block; margin-left: auto; margin-right: auto; max-width: 100%;" />

View file

@ -22,7 +22,6 @@ export const contentMap: ContentMap = {
},
posts: {},
series: {},
unsearchable: {},
}
export const seriesMap: SeriesMap = {}
export const portfolioData: PortfolioData = {
@ -49,9 +48,6 @@ if (!fs.lstatSync(markdownPath).isDirectory())
if (!fs.lstatSync(markdownPath + "/posts").isDirectory())
throw Error(`Cannot find directory: ${markdownPath + "/posts"}`)
if (!fs.lstatSync(markdownPath + "/unsearchable").isDirectory())
throw Error(`Cannot find directory: ${markdownPath + "/posts"}`)
if (!fs.lstatSync(markdownPath + "/series").isDirectory())
throw Error(`Cannot find directory: ${markdownPath + "/posts"}`)
@ -60,7 +56,6 @@ if (!fs.lstatSync(markdownPath + "/series").isDirectory())
*/
recursiveParse(ParseMode.POSTS, markdownPath + "/posts")
recursiveParse(ParseMode.UNSEARCHABLE, markdownPath + "/unsearchable")
recursiveParse(ParseMode.SERIES, markdownPath + "/series")
recursiveParse(ParseMode.PORTFOLIO, markdownPath + "/projects")

View file

@ -77,7 +77,7 @@ export default function parseMarkdown(
if (!frontMatter.title)
throw Error(`Title is not defined in file: ${path}`)
if (mode != ParseMode.UNSEARCHABLE && !frontMatter.date)
if (!frontMatter.date)
throw Error(`Date is not defined in file: ${path}`)
}

View file

@ -7,7 +7,6 @@ import { path2FileOrFolderName, path2URL } from "../util"
import parsePost from "./parsePost"
import parseProjects from "./parseProjects"
import parseSeries from "./parseSeries"
import parseUnsearchable from "./parseUnsearchable"
/**
* Data that's passed from {@link parseFile} to other function
@ -95,10 +94,6 @@ function parseFile(mode: ParseMode, path: string): void {
parseSeries(dataToPass)
break
case ParseMode.UNSEARCHABLE:
parseUnsearchable(dataToPass)
break
case ParseMode.PORTFOLIO:
parseProjects(dataToPass)
break

View file

@ -1,34 +0,0 @@
import { contentMap } from ".."
import { contentDirectoryPath } from "../config"
import { addDocument } from "../searchIndex"
import { writeToFile } from "../util"
import { DataToPass } from "."
export default function parseUnsearchable(data: DataToPass): void {
const { urlPath: _urlPath, markdownData } = data
// convert path like /XXX/YYY/ZZZ to /YYY/ZZZ
const urlPath = _urlPath.slice(_urlPath.slice(1).indexOf("/") + 1)
addDocument({
title: markdownData.title,
body: markdownData.content,
url: urlPath,
})
// Parse data that will be written to map.js
contentMap.unsearchable[urlPath] = {
title: markdownData.title as string,
}
/**
* Save content
*/
writeToFile(
`${contentDirectoryPath}/unsearchable${urlPath}.json`,
JSON.stringify({
content: markdownData.content,
})
)
}

View file

@ -23,10 +23,6 @@ export interface ContentMap {
// series posts have "previous post" and "next post" button so they need to be ordered
series: { [key: string]: Series }
// urls of unsearchable posts
// it is here to quickly check if a post exists or not
unsearchable: { [key: string]: { title: string } }
}
/**
@ -36,7 +32,6 @@ export interface ContentMap {
export enum ParseMode {
POSTS,
SERIES,
UNSEARCHABLE,
PORTFOLIO,
}