Skip to content

Commit

Permalink
Revert content
Browse files Browse the repository at this point in the history
  • Loading branch information
ProchaLu committed Jan 8, 2025
1 parent e7a9081 commit 5658851
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions utils/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,11 @@ export const getAllContentIds = (contentType: IContentType) => {
* @param {string} contentType Type of content
*/

export const getContentData = async (id: string, contentType: IContentType) => {
let contentTypeDirectory;
export const getContentData = async (
id: string,
contentType: IContentType,
): Promise<IContentDataWithDraftType> => {
let contentTypeDirectory: string;
let filenames;
switch (contentType.toLowerCase()) {
case 'articles':
Expand All @@ -140,7 +143,6 @@ export const getContentData = async (id: string, contentType: IContentType) => {
// loop through all the content types and compare the slug to get the filename
const match = filenames.filter((filename) => {
const filePath = path.join(contentTypeDirectory, filename);

const fileContent = fs.readFileSync(filePath, 'utf-8');
const matterResult = matter(fileContent);
const { slug } = matterResult.data;
Expand Down

0 comments on commit 5658851

Please sign in to comment.