ft-next-article-genre

v1.4.2
next-article-genre [![Build Status](https://travis-ci.org/Financial-Times/next-article-genre.svg?branch=master)](https://travis-ci.org/Financial-Times/next-article-genre) =======================

next-article-genre Build Status

Next currently categorizes content into four visually styling buckets - Default (News), Analysis, Comment and Lifestyle. This function takes a raw v1 article from CAPI, and returns either 'default', 'analysis', 'comment' or 'lifestyle' based on the genre of the article.

var getVisualCategorisation = require('ft-next-article-genre');
var theme = getVisualCategorisation(article.raw.item.metadata);

(August 2015 - as part of the design unification, genre differentiation has initially been turned off. This was achieved by defaulting the look up values for all genres to default. The original mapping is commented

To retrieve the genre that was previously returned pass in options as follows

var getEditorialTone = require('ft-next-article-genre');
var theme = getEditorialTone(article.raw.item.metadata, {requestedProp: 'editorialTone'});

).

npm i ft-next-article-genre

Metadata

  • Unknown
  • Whatever
  • Unknown
  • released 10/1/2015

Downloads