These commits at a settings toggle to optionally check for the existence of a 'layout' section in the NPR API response, and if present uses that layout to pull in order the corresponding paragraphs, images, externalAssets such as YouTube and Twitter oEmbeds, and HtmlAssets that are usually javascript or iframes. If one of the layout elements is a 'gallery' the primary image for the post is inserted in its place.
Leaving the toggle unchecked, or if no 'layout' section is found in the API response, leaves the previous handler for creating the post body unaltered.
These commits at a settings toggle to optionally check for the existence of a 'layout' section in the NPR API response, and if present uses that layout to pull in order the corresponding paragraphs, images, externalAssets such as YouTube and Twitter oEmbeds, and HtmlAssets that are usually javascript or iframes. If one of the layout elements is a 'gallery' the primary image for the post is inserted in its place.
Leaving the toggle unchecked, or if no 'layout' section is found in the API response, leaves the previous handler for creating the post body unaltered.