Skip to content

Commit

Permalink
Update to Next 14
Browse files Browse the repository at this point in the history
  • Loading branch information
staceyfenton committed Feb 8, 2024
1 parent b08fb76 commit a5dece9
Show file tree
Hide file tree
Showing 3 changed files with 1,307 additions and 520 deletions.
18 changes: 13 additions & 5 deletions lib/work.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import fs from 'fs'
import path from 'path'
import matter from 'gray-matter'
import remark from 'remark'
import html from 'remark-html'
import remarkHtml from 'remark-html'
import remarkParse from 'remark-parse'
import {unified} from 'unified'

const workDirectory = path.join(process.cwd(), 'work')

Expand Down Expand Up @@ -69,9 +70,16 @@ export async function getWorkData(id) {
const matterResult = matter(fileContents)

// Use remark to convert markdown into HTML string
const processedContent = await remark()
.use(html)
.process(matterResult.content)
// const processedContent = await remark()
// .use(html)
// .process(matterResult.content)
// const contentHtml = processedContent.toString()

const processedContent = await unified()
.use(remarkParse)
.use(remarkHtml)
.process(matterResult.content)

const contentHtml = processedContent.toString()

// Combine the data with the id
Expand Down
Loading

0 comments on commit a5dece9

Please sign in to comment.