Skip to content

Gatsby plugin to generate AMP(Accelerated Mobile Pages) from HTML

License

Notifications You must be signed in to change notification settings

djwinston/gatsby-plugin-html2amp

 
 

Repository files navigation

gatsby-plugin-html2amp

Create AMP(Accelerated Mobile Pages) for your Gatsby site by using html2amp

Install

$ npm install --save gatsby-plugin-html2amp

How to use

In gatsby-config.js

{
  resolve: 'gatsby-plugin-html2amp',
  options: {
    files: ['post/**/index.html', 'index.html'],
    publicPath: 'public',
    gaConfigPath: 'gaConfig.json',
    dist: 'public/dist'
  }
}

Options

  • files
    • List of generated html path patterns from publicPath
    • Default is [**/*.html]
  • publicPath
    • Directory for building by gatsby
    • Default is public
  • gaConfigPath
    • amp-analytics config json for google analytics
    • The path is from publicPath
    • Optional
  • dist
    • Path to output
    • If the options is not set files are override by AMP result

More Detail

Please check my article out for detail. ⚡

https://blog.tomoyukikashiro.me/post/amp-using-gatsby

About

Gatsby plugin to generate AMP(Accelerated Mobile Pages) from HTML

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%