Skip to content

Commit

Permalink
try utf8 encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
kchenturtles committed Dec 23, 2023
1 parent 6bc1c0b commit 83c93d9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/postPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function PostPreview({ post }: { post: Items }) {
return (
<div className = {styles.preview}>
<Link className = { styles.title } href = { `/blog/${post["slug"]}`} onClick = {() => {
router.push(`/blog/${post["slug"]}`)
router.push(`/blog/${post["slug"]}`);
}}> {post.title}
</Link>
<div> {post.date} </div>
Expand Down
2 changes: 1 addition & 1 deletion lib/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function getPostSlugs() {
export function getPostBySlug(slug: string, fields: string[] = []) {
const realSlug = slug.replace(/\.md$/, '');
const fullPath = join(postsDirectory, `${realSlug}.md`);
const fileContents = fs.readFileSync(fullPath, null);
const fileContents = fs.readFileSync(fullPath, "utf8");
const { data, content } = matter(fileContents);

type Items = {
Expand Down

0 comments on commit 83c93d9

Please sign in to comment.