-
Notifications
You must be signed in to change notification settings - Fork 382
Add theme support mode selection in AMP general settings page #1196
Description
In 0.6 we added the ability for users to select which post types they wanted to make available in AMP instead of requiring them to include add_post_type_support() calls in their theme. In 0.7 the amp theme support flag was added, but there was no UI to enable it. We should allow for a user to enable amp theme support in the admin just as they can do for post types.
Since the core themes for Twenty Seventeen, Twenty Sixteen, and Twenty Fifteen all are compatible with AMP via the core theme sanitizer in the plugin (via #1074), users can be encouraged to switch from the legacy templates to their theme's templates just via a toggle.
This is a natural place to incorporate the utility for doing a scan of a site to check its compatibility (see #1007).
This screen could be extended to also provide the user with control over sanitization behavior. (This is also related to the need to disable serving dirty AMP for the time being, per #1192). For example, there should be a toggle to automatically accept tree shaking. Additionally, there could be a flag for whether to automatically accept the sanitization of all validation errors.
With #934 there would also need to be a way to indicate a subset-native mode, where AMP is served on canonical URLs for some subset of the site (e.g. singular template) but on others there is no AMP version available, not even on a separate AMP-specific URL (in paired mode).