Compile story-json documents into AMP stories
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
flow-typed/npm
lib
.babelrc
.flowconfig
.gitignore
.npmignore
LICENSE
README.md
flow-types.js
hello-world.amp.html
inline-text.amp.html
package-lock.json
package.json
test.js

README.md

story-json-to-amp

Compile story-json documents into AMP stories.

Not all features of the story-json format are supported at the moment. Open an issue if you need something that isn't supported yet. PRs are always welcome!

Usage

import story from './story.json';
import storyJsonToAmp from 'story-json-to-amp';

const ampHtml = storyJsonToAmp(story);

API

In addition to standard story-json properties, a few special optional properties can be added to the document:

Name Description
customCss Extra CSS to append to AMP story document. This is useful for adding fonts or making AMP-specific customizations.
analytics Array of AMP analytics objects
bookendConfigSrc Bookend endpoint URL

Example

Here's an AMP story generated by this module:

https://mic.com/stories/327/what-happens-in-your-brain-when-you-listen-to-music

License

MIT