Generate mock data for Metalsmith HTML templates
- Install metalsmith-mock with npm
npm install metalsmith-mock --save-dev
data-mockattributes to html
metalsmith-mockplugin to metalsmith
const metalsmith = ;const metalsmithMock = ;;
metalsmith-mock not only allows for the dynamic creation of mock data but also the reuse of the mock data identities throughout HTML templates.
When metalsmith-mock first encounters a
data-mock attribute, it checks to see if that mock identity key has been previously defined and if so, uses that mock identify throughout all metalsmith templates.
If the mock identify key hasn't been previously defined, a new identify is created and cached in
Open source software components distributed or made available in the Availity Materials are licensed to Company under the terms of the applicable open source license agreements, which may be found in text files included in the Availity Materials.
Copyright and license
Code and documentation copyright 2016 Availity, LLC. Code released under the MIT license.