Skip to content

0.3.3

Compare
Choose a tag to compare
@schickling schickling released this 31 May 17:54
· 33 commits to main since this release

ℹ️ [TLDR] New onSuccess callback that runs after completing a build successfully

onSuccess Callback

A new callback will now be called when a successful build has completed.

The callback function receives a single argument that is an asynchronous function from which you can access data objects processed and generated by Contentlayer.

import { makeSource } from '@contentlayer/source-files'

export default makeSource({
  onSuccess: async (importData) => {
    const { allDocuments } = await importData()
    console.log('allDocuments', allDocuments.length)
  }
})

Running a build with the above configuration would yield something like the following on the console.

allDocuments 3

Closes #473

Better Non-Latin Character Support

Support has improved for characters in non-Latin languages. Fixes #337.

🙌 Thanks to @huanfe1 for help!

Other Improvements

Here are the other improvements shipped with this version.

Fix Body Field Handling for MDX

@stefanprobst resolved the discrepancy in handling a body field in frontmatter. Now, both Markdown and MDX files behave in the same way, supporting a body field in the frontmatter. See #451 for details.

Upgraded Dependencies

Dependencies have been upgraded to avoid warning messages. Fixes #360.