Skip to content

Commit

Permalink
setup frontmatter and collection for mdx pages
Browse files Browse the repository at this point in the history
  • Loading branch information
ob6160 committed May 27, 2024
1 parent 2319fed commit 28c41de
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
File renamed without changes.
4 changes: 2 additions & 2 deletions contentlayer.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ export const Post = defineDocumentType(() => ({

export const Page = defineDocumentType(() => ({
name: 'Page',
filePathPattern: `pages/**/*.md`,
contentType: 'markdown',
filePathPattern: `pages/**/*.mdx`,
contentType: 'mdx',
fields: {
title: { type: 'string', required: true },
date: { type: 'date', required: true },
Expand Down
17 changes: 9 additions & 8 deletions public/admin/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ public_folder: /images/uploads
collections:
- name: "pages"
label: "Pages"
files:
- label: "Home"
name: "home"
file: "content/pages/home.md"
fields:
- { label: "Title", name: "title", widget: "string"}
- { label: "Publish Date", name: "date", widget: "datetime" }
- { label: "Author", name: "author", widget: "string" }
label_singular: 'Documentation'
folder: content/pages
extension: "mdx"
format: "frontmatter"
fields:
- { label: "Title", name: "title", widget: "string"}
- { label: "Publish Date", name: "date", widget: "datetime" }
- { label: "Author", name: "author", widget: "string" }
- {label: "Body", name: "body", widget: "markdown"}

0 comments on commit 28c41de

Please sign in to comment.