-
Notifications
You must be signed in to change notification settings - Fork 385
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
Refactor AMP modes #2550
Refactor AMP modes #2550
Conversation
Excellent. These changes increase both user friendliness and flexibility. Kudos on removing the option for Reader mode when Transitional mode is added via theme support. |
This means users can go from Transitional to Native also in all cases. It would be good to allow users in Transitional mode to chose Native AMP for some pages. This would enable sites to track progress of the "AMPlification" of their content ~ |
And when |
Chosing AMP-first for some URLs but paired for others is somewhat described under the “Mixed-Some-Only-AMP” mode in #934 IMO that adds a lot of complexity that I highly doubt users would be likely to leverage. Possibly some complicated changes to validation logic as well. Unsure how scores would be calculated. Decisions not options. I think we should help users get to AMP-first on URLs that support it. For other templates/URLs, non-AMP would be served unless the theme is using Bento AMP components. |
I don't think the complexity will be much higher; and the benefit will be significant especially if weighed by the benefit of being able to measure the progression of a site towards AMP first. And it also captures the essence of a The current Transitional approach is to wait until full parity (visual, functional) is achieved for all templates, before the "AMP-first" switch is turned. In this case, 95% of the site can be ready to switch, but it needs to wait for the rest to achieve full parity. |
a9f7409
to
6f8a8d8
Compare
Also remove some test debug code
Closing the loop on this. We agree that a more fluid model for the Transitional mode would facilitate the transition of sites towards AMP-first experiences by avoiding the current all-or-nothing approach. However, we will be able to achieve this in a much easier way once Bento AMP is available. With Bento AMP a fully fluid transitional mode can be achieved without a lot of the complexity. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few minor comments. Ready to ship.
This PR intends to refactor the AMP modes in the plugin in order to resolve three issues:
add_theme_support('amp', ['paired' => true])
.native
tostandard
, andpaired
totransitional
.Always allow switching themes with built-in Transitional support to Native
When a theme had
add_theme_support( 'amp', array( 'paired' => true ) )
they would see:Now, they see this instead:
This allows a theme which declares support for both AMP and non-AMP, to just opt to only serve AMP pages instead of being paired mode. This allows a theme like Neve to be used in either mode, even though it is defined as being
paired => true
.Additionally, if they had
add_theme_support( 'amp' )
then before they would see:Now they see a slightly tweaked message:
Notice the link to the ecosystem page is moved to the bottom.
Generator Tag
Given a site in transitional mode with both website and stories experiences enabled, the generator tag is now:
Note the new
experiences
param. If switching to standard (formerly native) mode, this is also reflected:If stories is disabled, then this is shown as:
If website is disabled but stories is enabled, then: