Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

trell-story-json-to-amp

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

trell-story-json-to-amp

Convert story JSON to STAMP HTML.

  • 2.0.16
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Cloned repo from https://github.com/micnews/story-json-to-stamp

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:

NameDescription
preview.publisherREQUIRED. The name of the story's publisher.
preview.publisherLogoSrcREQUIRED. The publisher's logo in square format (1x1 aspect ratio).
preview.posterPortraitSrcREQUIRED. The story poster in portrait format (3x4 aspect ratio).
preview.posterSquareSrcThe story poster in square format (1x1 aspect ratio).
preview.posterLandscapeSrcThe story poster in landscape format (4x3 aspect ratio).
customCssExtra CSS to append to AMP story document. This is useful for adding fonts or making AMP-specific customizations.
analyticsArray of AMP analytics objects
bookendConfigSrcBookend 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

Keywords

FAQs

Package last updated on 09 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc