simple-reproduction

    1.4.4 • Public • Published

    simple-reproduction

    copy html with meta rewriting.

    usage

    init

    const SimpleReproduction = require('simple-reproduction');
     
    const DIST = 'dist';
     
    const reproduction = new SimpleReproduction({
      dest: DIST,
    });
     
    reproduction.on('write', ({ htmlDest }) => {
      console.log('[write]', htmlDest);
    });
     
    reproduction.on('end', () => {
      console.log('[done]');
    });

    copy html with injection

    reproduction.start({
      src: `${DIST}/index.html`,
      routes: {
        ['/share-test']: {
          title: 'dummy',
          meta: {
            description: 'dummy',
            'og:image': 'http://example.com/dummy1.png',
          },
        },
        ['/share-test2']: {
          title: 'dummy2',
          meta: {
            description: 'dummy',
            'og:image': 'http://example.com/dummy2.png',
          },
        },
      },
    });

    build pug & html injection

    reproduction.start({
      src: `${DIST}/index.pug`,
      routes: {
        ['/share-test3']: {
          locals: {
            title: 'dummy3',
            description: 'dummy3',
            shareImage: 'http://example.com/dummy3.png',
          },
        },
      },
    });

    Keywords

    none

    Install

    npm i simple-reproduction

    DownloadsWeekly Downloads

    0

    Version

    1.4.4

    License

    ISC

    Unpacked Size

    8.99 kB

    Total Files

    11

    Last publish

    Collaborators

    • fnobi