Skip to content

Commit

Permalink
@nuxt/content support: Test if markdown (#92)
Browse files Browse the repository at this point in the history
fix(nuxt-content): only add <style> block if the file is markdown, fixes #91
  • Loading branch information
freality committed May 27, 2021
1 parent 13e0659 commit 1c8021d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ const windicssModule: Module<UserOptions> = function(moduleOptions) {
if (nuxtOptions.dev) {
// @nuxt/content support, only required in dev
nuxt.hook('content:file:beforeParse', async(md: File) => {
// only applies to .md files
if (md.extension !== '.md') return

// instead of rebuilding the entire windi virtual module we will just insert our styles into the md file
const utils = createUtils({
...windiConfig,
Expand Down

0 comments on commit 1c8021d

Please sign in to comment.