Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add theme support mode selection in AMP general settings page #1196

Closed
westonruter opened this issue Jun 5, 2018 · 1 comment
Closed

Add theme support mode selection in AMP general settings page #1196

westonruter opened this issue Jun 5, 2018 · 1 comment
Milestone

Comments

@westonruter
Copy link
Member

westonruter commented Jun 5, 2018

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).

@westonruter westonruter added this to the v1.0 milestone Jun 5, 2018
@westonruter
Copy link
Member Author

Some initial prototypes:

image

image

image

westonruter added a commit that referenced this issue Jun 6, 2018
… handling

* Add admin settings for picking between disabled, paired, and native theme support. See #1196.
* Add checkbox for automatically allowing tree shaking.
* Add checkbox for automatically sanitizing all validation errors (including tree shaking).
* Make explicitly clear that unaccepted validation errors will block rendering on AMP
* Prevent serving dirty AMP by forcibly sanitizing all validation errors when amp_is_canonical(). See #1192.
* When validation errors are automatically sanitized, ensure the terms' term_group is updated when re-checking.
* Update AMP_Options_Manager::get_options() and to return default values.
westonruter added a commit that referenced this issue Jun 6, 2018
… handling

* Add admin settings for picking between disabled, paired, and native theme support. See #1196.
* Add checkbox for automatically allowing tree shaking.
* Add checkbox for automatically sanitizing all validation errors (including tree shaking).
* Make explicitly clear that unaccepted validation errors will block rendering on AMP
* Prevent serving dirty AMP by forcibly sanitizing all validation errors when amp_is_canonical(). See #1192.
* When validation errors are automatically sanitized, ensure the terms' term_group is updated when re-checking.
* Update AMP_Options_Manager::get_options() and to return default values.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant