Skip to content

Releases: hmsk/frontmatter-markdown-loader

v3.0.0: Assets Transformation for vue.*

27 Oct 01:24
v3.0.0
30622a6
Compare
Choose a tag to compare

Assets paths in markdown body will be transformed

#74 (Solves #41)

<img src="./img/something.png" /><img src=require("./img/something.png") />

This matches the default behavior of vue-loader. So this change will support Nuxt's home alias like ~/assets/image.png naturally.

Breaking Changes

Relative path on assets attributes on Markdown body will be replaced with require(attributeValue)

  • video element: src, poster attribute
  • source element: src attribute
  • img element: src attribute
  • image element: xlink:href, href attribute
  • use element: xlink:href, href attribute

Custom element should have "closing tag" (or close itself) always

<child-element> (without closing tag) shoul be updated to <child-element />

vue.render, vue.staticRenderFns return function instead of source string

import fm from "something.md"
import OtherComponent from "OtherComponent.vue"

export default {
  data () {
    return {
      templateRender: null
    }
  },

  components: {
    OtherComponent // If markdown has `<other-component>` in body, will work :)
  },

  render (createElement) {
    return this.templateRender ? this.templateRender() : createElement("div", "Rendering");
  },

  created () {
-    this.templateRender = new Function(fm.vue.render)();
-    this.$options.staticRenderFns = new Function(fm.vue.staticRenderFns)()
+    this.templateRender = fm.vue.render;
+    this.$options.staticRenderFns = fm.vue.staticRenderFns;
  }
}

See migration guide: https://hmsk.github.io/frontmatter-markdown-loader/migration.html#migrate-to-3

Other Changes

  • Update devDependencies

v2.3.0...v3.0.0

v3.0.0-2

23 Oct 05:35
1b15ff4
Compare
Choose a tag to compare
v3.0.0-2 Pre-release
Pre-release
  • Accept vue.transformAssetUrls: false to disable transformation
  • Update docs for release

v3.0.0-1...v3.0.0-2

v3.0.0-1

22 Oct 04:59
2c2de6e
Compare
Choose a tag to compare
v3.0.0-1 Pre-release
Pre-release
  • Accept vue.transformAssetUrls option to configure

v3.0.0-0...v3.0.0-1

v3.0.0-0

20 Oct 07:28
2c2de6e
Compare
Choose a tag to compare
v3.0.0-0 Pre-release
Pre-release

Pre-Release of #74 which supports transpiling assets on markdown body for Vue

v2.3.0...v3.0.0-0

v2.3.0: Renderable React Component

17 Oct 04:54
v2.3.0
14bc9f8
Compare
Choose a tag to compare

Import markdown, render as React component 👾

#69

Mode.REACT requests to get function which renders React component.

{
  test: /\.md$/,
  loader: 'frontmatter-markdown-loader'
  options: {
    mode: [Mode.REACT]
  }
}
import React from 'react'

import { react as Sample } from './sample.md' // <-- THIS

export default function OneComponent() {
  return (
    <div>
      <h1>Content</h1>
      <Sample /> <!-- This renders compiled markdown! -->
    </div>
  );
}

The React component can take prop for components on markdown 🔮

---
title: A frontmatter
description: Having ExternalComponent on the content
---

Hi, I'm a component. <MyDecorator>Apparently, this sentence will be made bold and italic</MyDecorator>
import React from 'react'
import { react as Sample } from './sample.md'

export default function DecoratedMarkdown() {
  const BoldAndItalic = ({children}) => <strong><i>{children}</i></strong>

  return (
    <div>
      <h1>Content</h1>
      <Sample MyDecorator={BoldAndItalic} />
    </div>
  );
}

Other Changes

v2.2.0...v2.3.0

v2.3.0 beta 0

13 Oct 07:48
d9e1a32
Compare
Choose a tag to compare
v2.3.0 beta 0 Pre-release
Pre-release
  • Add "react-component" mode #69
    • Importing .md returns react property which is renderable React component

v2.2.0...v2.3.0-0

v2.2.0: Support configuration for markdown-it

12 Oct 07:02
v2.2.0
b759c87
Compare
Choose a tag to compare

v2.1.0...v2.2.0

Special Thanks

v2.1.0

10 Sep 23:12
v2.1.0
c6351f9
Compare
Choose a tag to compare
  • Update dependency: markdown-it 9 -> 10

v2.0.0...v2.1.0

v2.0.0: Selective Import

26 Aug 10:53
v2.0.0
fb2cfb2
Compare
Choose a tag to compare
  • Save importing size as much as possible by introducing selective options
  • The whole documentation is moved to /doc and deployed to the page

Breaking Changes

See the migration guide: https://hmsk.github.io/frontmatter-markdown-loader/migration.html

Introduce options.mode

  • On the default, doesn't return body
  • vue: true is replaced with VUE_COMPONENT mode, VUE_RENDER_FUNCTIONS mode

Refer https://hmsk.github.io/frontmatter-markdown-loader/options.html#mode to understand each mode.

Move attributes._meta

  • To meta on the top level
  • META mode should be enabled to import

Commits from v1.8.0

v2.0.0 beta 1

18 Aug 06:32
v2.0.0-1
07007ad
Compare
Choose a tag to compare
v2.0.0 beta 1 Pre-release
Pre-release
  • Stop exporting multiple members Webpack doesn't expect that 902bc12

v2.0.0-0...v2.0.0-1