added toc to portfolio projects
This commit is contained in:
parent
8285b4ba57
commit
9bbbbfe66e
1 changed files with 3 additions and 1 deletions
|
@ -3,12 +3,13 @@ import tinycolor from "tinycolor2"
|
||||||
|
|
||||||
import { contentDirectoryPath, iconsDirectoryPath } from "../config"
|
import { contentDirectoryPath, iconsDirectoryPath } from "../config"
|
||||||
import { PortfolioProject } from "../../types/types"
|
import { PortfolioProject } from "../../types/types"
|
||||||
|
import { generateToc } from "../parseMarkdown"
|
||||||
import { writeToFile } from "../util"
|
import { writeToFile } from "../util"
|
||||||
import { portfolioData } from ".."
|
import { portfolioData } from ".."
|
||||||
import { DataToPass } from "."
|
import { DataToPass } from "."
|
||||||
|
|
||||||
export default function parsePortfolio(data: DataToPass): void {
|
export default function parsePortfolio(data: DataToPass): void {
|
||||||
const { urlPath, markdownData } = data
|
const { urlPath, markdownRaw, markdownData } = data
|
||||||
|
|
||||||
const lastPath = urlPath.slice(urlPath.lastIndexOf("/") + 1)
|
const lastPath = urlPath.slice(urlPath.lastIndexOf("/") + 1)
|
||||||
|
|
||||||
|
@ -53,6 +54,7 @@ export default function parsePortfolio(data: DataToPass): void {
|
||||||
`${contentDirectoryPath}${urlPath}.json`,
|
`${contentDirectoryPath}${urlPath}.json`,
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
content: markdownData.content,
|
content: markdownData.content,
|
||||||
|
toc: generateToc(markdownRaw),
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue