Skip to content

Commit

Permalink
feat: contentlayer 파일 패턴 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
paulcjy committed Sep 19, 2024
1 parent 908e4ba commit af71bd8
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions contentlayer.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,10 @@ const createPathParser = () => {

const [date, ...splitTitle] = path.split('_')

const [year, month, day] = date.split('/')
const [year, month, day] = date.split('/').map(Number)
const title = splitTitle.join('\n')

const result = {
date,
year: Number(year),
month: Number(month),
day: Number(day),
title,
}
const result = { date, year, month, day, title }

cache.set(path, result)
return result
Expand All @@ -38,7 +32,7 @@ const pathParser = createPathParser()

export const Bible = defineDocumentType(() => ({
name: 'Bible',
filePathPattern: `[0-9][0-9][0-9][0-9]/[0-9][0-9]/*.md`,
filePathPattern: `[0-9][0-9][0-9][0-9]/([0-9]|[0-9][0-9])/*.md`,
fields: {},
computedFields: {
date: {
Expand Down

0 comments on commit af71bd8

Please sign in to comment.