Customizing JSON - alleyinteractive/apple-news GitHub Wiki
For advanced users, the Apple News plugin allows you to customize JSON. Each Apple News component that is handled by the plugin has one or more JSON specs for the main component JSON, layouts and/or styles. Some components have multiple specs for each of those if they have different visual appearances in different contexts. Editing these specs allows you to implement more advanced features from Apple News Format than can be handled via theme settings.
To get started, go to Customize JSON from the Apple News menu:

Select the theme for which you want to customize JSON.
Next, select the component you wish to edit from the dropdown:

You will then see a form that shows the editable JSON specs for that component.

Some specs will include values in the format #token#. These are tokens that represent dynamic values that will be inserted into the JSON when the post is published to Apple News.
There are three types of tokens:
- Spec-specific: These will be included with the default spec, and can be removed, but cannot be added to different specs. They are computed at the time that the spec is translated to JSON, and are specific to a particular spec.
- Postmeta: You can include postmeta values by including a token in the format
#postmeta.meta_key#wheremeta_keyis the key of the postmeta that you want to include. Note that this only works on single postmeta values (get_post_metais called with the$singleparameter set totrue). - Settings: All of the theme settings are available to be included in custom JSON specs. To include a value for a theme setting, simply use
#setting_name#wheresetting_nameis the name of the setting you wish to include. The full list of available theme settings for use in tokens is as follows:ad_frequencyad_marginblockquote_background_colorblockquote_background_color_darkblockquote_border_colorblockquote_border_color_darkblockquote_border_styleblockquote_border_widthblockquote_colorblockquote_color_darkblockquote_fontblockquote_line_heightblockquote_sizeblockquote_trackingbody_background_colorbody_background_color_darkbody_colorbody_color_darkbody_fontbody_line_heightbody_link_colorbody_link_color_darkbody_orientationbody_sizebody_trackingbyline_colorbyline_color_darkbyline_fontbyline_formatbyline_line_heightbyline_sizebyline_trackingcaption_colorcaption_color_darkcaption_fontcaption_line_heightcaption_sizecaption_trackingcover_captiondropcap_background_colordropcap_background_color_darkdropcap_colordropcap_color_darkdropcap_fontdropcap_number_of_charactersdropcap_number_of_linesdropcap_number_of_raised_linesdropcap_paddingenable_advertisementgallery_typeheader1_colorheader1_color_darkheader1_fontheader1_line_heightheader1_sizeheader1_trackingheader2_colorheader2_color_darkheader2_fontheader2_line_heightheader2_sizeheader2_trackingheader3_colorheader3_color_darkheader3_fontheader3_line_heightheader3_sizeheader3_trackingheader4_colorheader4_color_darkheader4_fontheader4_line_heightheader4_sizeheader4_trackingheader5_colorheader5_color_darkheader5_fontheader5_line_heightheader5_sizeheader5_trackingheader6_colorheader6_color_darkheader6_fontheader6_line_heightheader6_sizeheader6_trackinginitial_dropcaplayout_gutterlayout_marginlayout_widthmonospaced_colormonospaced_color_darkmonospaced_fontmonospaced_line_heightmonospaced_sizemonospaced_trackingpullquote_border_colorpullquote_border_color_darkpullquote_border_stylepullquote_border_widthpullquote_colorpullquote_color_darkpullquote_fontpullquote_hanging_punctuationpullquote_line_heightpullquote_sizepullquote_trackingpullquote_transformrecipe_background_colorrecipe_background_color_darkrecipe_body_background_colorrecipe_body_background_color_darkrecipe_body_colorrecipe_body_color_darkrecipe_body_fontrecipe_body_line_heightrecipe_body_link_colorrecipe_body_link_color_darkrecipe_body_sizerecipe_body_trackingrecipe_caption_colorrecipe_caption_color_darkrecipe_caption_fontrecipe_caption_line_heightrecipe_caption_link_colorrecipe_caption_link_color_darkrecipe_caption_sizerecipe_caption_trackingrecipe_details_background_colorrecipe_details_background_color_darkrecipe_details_colorrecipe_details_color_darkrecipe_details_fontrecipe_details_line_heightrecipe_details_link_colorrecipe_details_link_color_darkrecipe_details_sizerecipe_details_trackingrecipe_header2_colorrecipe_header2_color_darkrecipe_header2_fontrecipe_header2_line_heightrecipe_header2_sizerecipe_header2_trackingrecipe_header3_colorrecipe_header3_color_darkrecipe_header3_fontrecipe_header3_line_heightrecipe_header3_sizerecipe_header3_trackingrecipe_header4_colorrecipe_header4_color_darkrecipe_header4_fontrecipe_header4_line_heightrecipe_header4_sizerecipe_header4_trackingrecipe_title_colorrecipe_title_color_darkrecipe_title_fontrecipe_title_line_heightrecipe_title_sizerecipe_title_trackingtable_body_background_colortable_body_background_color_darktable_body_colortable_body_color_darktable_body_fonttable_body_horizontal_alignmenttable_body_line_heighttable_body_paddingtable_body_sizetable_body_trackingtable_body_vertical_alignmenttable_border_colortable_border_color_darktable_border_styletable_border_widthtable_header_background_colortable_header_background_color_darktable_header_colortable_header_color_darktable_header_fonttable_header_horizontal_alignmenttable_header_line_heighttable_header_paddingtable_header_sizetable_header_trackingtable_header_vertical_alignment
When you have finished editing, click the Save JSON button. The new specs will now be used for that component when publishing posts to Apple News using the selected theme moving forward.
The following components and JSON specs are supported:
Advertisement
JSON
The main component JSON.
Layout
The default component layout.
Audio
JSON With Caption Text
The main component JSON, which is used when a caption is present.
JSON
The main component JSON.
Body
JSON
The main component JSON.
Layout
The default component layout.
Layout for Last Component
Layout settings for the last body component only.
Default Style
The default component style.
Drop Cap Style
The style for the first body component when drop caps are enabled.
Byline
JSON
The main component JSON.
Style
The default component style.
Layout
The default component layout.
Cover
JSON
The main component JSON.
JSON with Caption
The main component JSON, which is used when a caption is present.
Layout
The default component layout.
Layout with Caption
The default component layout, which is used when a caption is present.
Below Text Layout
The component layout to use when the cover is positioned below text.
Divider
JSON
The main component JSON.
Layout
The default component layout.
Embed Generic
JSON
The main component JSON.
Layout
The default component layout.
Embed Web Video (Youtube/Vimeo)
JSON
The main component JSON.
Layout
The default component layout.
End of Article
This is a special component that is automatically inserted at the end of each article rendered by this theme. You can add whatever content you like, as long as it is valid Apple News Format. Typical use cases here would be calls to action for things like subscribing to newsletters.
JSON
The main component JSON. Defaults to nothing, in which case no End of Article module will appear. You may insert whatever you like here.
Layout
The default component layout. Defaults to nothing, in which case there will be no layout applied. You may insert whatever you like her.
JSON
The main component JSON.
Gallery
JSON
The main component JSON.
Layout
The default component layout.
Heading
JSON
The main component JSON.
Layout
The default component layout.
Level 1 Style
The style for level 1 (H1) components.
Level 2 Style
The style for level 2 (H2) components.
Level 3 Style
The style for level 3 (H3) components.
Level 4 Style
The style for level 4 (H4) components.
Level 5 Style
The style for level 5 (H5) components.
Level 6 Style
The style for level 6 (H6) components.
Image
JSON without caption
Main component JSON for images without captions.
JSON with caption
Main component JSON for images with captions.
Anchored Layout
Layout for images that are anchored to another component.
Non-anchored Layout
Layout for images that are not anchored to another component.
Non-anchored with Full Bleed Images Layout
Layout for images that are not anchored to another component when full bleed images are enabled.
JSON
The main component JSON.
Intro
JSON
The main component JSON.
Style
The default component style.
Link Button
JSON
The main component JSON.
Button Layout
The default component style.
Link Button Style
Styles for the button itself.
Link Button Text Style
Styles for the text in the button.
Quote
Blockquote Without Border JSON
Main component JSON when borders are not enabled for blockquotes in the theme.
Blockquote With Border JSON
Main component JSON when borders are enabled for blockquotes in the theme.
Blockquote Layout
The default blockquote layout.
Blockquote Style
The default blockquote style.
Pull quote Without Border JSON
Main component JSON when borders are not enabled for blockquotes in the theme.
Pull quote With Border JSON
Main component JSON when borders are enabled for blockquotes in the theme.
Pull quote Layout
The default blockquote layout.
Pull quote Style
The default blockquote style.
Recipe
JSON
The main component JSON for Recipe components generated from JSON-LD data.
Recipe Body Layout
Layout for recipe body text.
Recipe Body Text Style
Style for recipe body text.
Recipe Header 2 Layout
Layout for subheadings in recipes.
Recipe Header 2 Text Style
Style for subheadings in recipes.
Recipe Header 3 Layout
Layout for subheadings in recipes.
Recipe Header 3 Text Style
Style for subheadings in recipes.
Recipe Header 4 Layout
Layout for subheadings in recipes.
Recipe Header 4 Text Style
Style for subheadings in recipes.
Recipe Details Layout
Layout for recipe details like prep time.
Recipe Details Text Style
Layout for recipe details like prep time.
JSON for a Section of Recipe Instructions
Component JSON for a single section of instructions in a multi-section set of instructions.
JSON for a Step Within a Section of Recipe Instructions
Component JSON for a single step in a multi-section set of instructions.
JSON for a Standalone Step in Recipe Instructions
Component JSON for a single step in a flat list of instructions.
JSON for a Wrapper Only
Component JSON used when "Build Recipe Component From Structured Data" is set to "no."
Table
JSON
The main component JSON.
JSON With Caption Text
The main component JSON, which is used when a caption is present.
Table Layout
The default component layout.
Table Style
The default component style.
Title
JSON
The main component JSON.
Style
The default component style.
Layout
The default component layout.
Tweet
JSON
The main component JSON.
Layout
The default component layout.
Video
JSON With Caption Text
The main component JSON, which is used when a caption is present.
JSON
The main component JSON.