refactor(content): remove unsearchable content
This commit is contained in:
parent
af35b116a0
commit
335c23ad9c
6 changed files with 1 additions and 84 deletions
|
@ -1,34 +0,0 @@
|
||||||
---
|
|
||||||
title: Resume
|
|
||||||
---
|
|
||||||
|
|
||||||
## Jimin Kim
|
|
||||||
|
|
||||||
[](https://github.com/developomp)
|
|
||||||
[](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%;" />
|
|
|
@ -22,7 +22,6 @@ export const contentMap: ContentMap = {
|
||||||
},
|
},
|
||||||
posts: {},
|
posts: {},
|
||||||
series: {},
|
series: {},
|
||||||
unsearchable: {},
|
|
||||||
}
|
}
|
||||||
export const seriesMap: SeriesMap = {}
|
export const seriesMap: SeriesMap = {}
|
||||||
export const portfolioData: PortfolioData = {
|
export const portfolioData: PortfolioData = {
|
||||||
|
@ -49,9 +48,6 @@ if (!fs.lstatSync(markdownPath).isDirectory())
|
||||||
if (!fs.lstatSync(markdownPath + "/posts").isDirectory())
|
if (!fs.lstatSync(markdownPath + "/posts").isDirectory())
|
||||||
throw Error(`Cannot find directory: ${markdownPath + "/posts"}`)
|
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())
|
if (!fs.lstatSync(markdownPath + "/series").isDirectory())
|
||||||
throw Error(`Cannot find directory: ${markdownPath + "/posts"}`)
|
throw Error(`Cannot find directory: ${markdownPath + "/posts"}`)
|
||||||
|
|
||||||
|
@ -60,7 +56,6 @@ if (!fs.lstatSync(markdownPath + "/series").isDirectory())
|
||||||
*/
|
*/
|
||||||
|
|
||||||
recursiveParse(ParseMode.POSTS, markdownPath + "/posts")
|
recursiveParse(ParseMode.POSTS, markdownPath + "/posts")
|
||||||
recursiveParse(ParseMode.UNSEARCHABLE, markdownPath + "/unsearchable")
|
|
||||||
recursiveParse(ParseMode.SERIES, markdownPath + "/series")
|
recursiveParse(ParseMode.SERIES, markdownPath + "/series")
|
||||||
recursiveParse(ParseMode.PORTFOLIO, markdownPath + "/projects")
|
recursiveParse(ParseMode.PORTFOLIO, markdownPath + "/projects")
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ export default function parseMarkdown(
|
||||||
if (!frontMatter.title)
|
if (!frontMatter.title)
|
||||||
throw Error(`Title is not defined in file: ${path}`)
|
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}`)
|
throw Error(`Date is not defined in file: ${path}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@ import { path2FileOrFolderName, path2URL } from "../util"
|
||||||
import parsePost from "./parsePost"
|
import parsePost from "./parsePost"
|
||||||
import parseProjects from "./parseProjects"
|
import parseProjects from "./parseProjects"
|
||||||
import parseSeries from "./parseSeries"
|
import parseSeries from "./parseSeries"
|
||||||
import parseUnsearchable from "./parseUnsearchable"
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Data that's passed from {@link parseFile} to other function
|
* Data that's passed from {@link parseFile} to other function
|
||||||
|
@ -95,10 +94,6 @@ function parseFile(mode: ParseMode, path: string): void {
|
||||||
parseSeries(dataToPass)
|
parseSeries(dataToPass)
|
||||||
break
|
break
|
||||||
|
|
||||||
case ParseMode.UNSEARCHABLE:
|
|
||||||
parseUnsearchable(dataToPass)
|
|
||||||
break
|
|
||||||
|
|
||||||
case ParseMode.PORTFOLIO:
|
case ParseMode.PORTFOLIO:
|
||||||
parseProjects(dataToPass)
|
parseProjects(dataToPass)
|
||||||
break
|
break
|
||||||
|
|
|
@ -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,
|
|
||||||
})
|
|
||||||
)
|
|
||||||
}
|
|
|
@ -23,10 +23,6 @@ export interface ContentMap {
|
||||||
|
|
||||||
// series posts have "previous post" and "next post" button so they need to be ordered
|
// series posts have "previous post" and "next post" button so they need to be ordered
|
||||||
series: { [key: string]: Series }
|
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 {
|
export enum ParseMode {
|
||||||
POSTS,
|
POSTS,
|
||||||
SERIES,
|
SERIES,
|
||||||
UNSEARCHABLE,
|
|
||||||
PORTFOLIO,
|
PORTFOLIO,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue