Support Metatag module and fix render pipeline bypass

Created on 8 February 2018, over 6 years ago
Updated 15 February 2023, over 1 year ago

Hey, great module! I've used it to implement AMP pages on a site I'm developing.

One miss with this module is that it does not allow meta tags from the metatag module to be placed on AMP pages. This is huge for the usefulness of this module I feel, since AMP pages are meant to greatly enhance your search presence.

To tackle this, I started investigating how metatag includes its tags. It uses #attached, which gets processed through core's render pipeline. AMP pages, however, remove the #attached part of pages entirely in favor of building their own page render array in the controller. While this is good since it makes nice AMP pages without "extra" libraries/css creeping in, I feel that it is missing the benefits of using the render pipeline properly.

As an aside, I feel like AMP is a different response type altogether, much like how 'html', 'ajax', etc are differentiated in core. These AMP pages are still being treated as the HTML type, and providing core HTML responses. Extending HTML seems like it would be more appropriate.

I have built a separate module with some small mods to simple_amp, to get meta tags working with the knowledge above. For longevity I don't feel like this is the best approach for my project since this module will see future changes, so I'm going to work my separate module into simple_amp's codebase here to provide a larger patch. It seems like this patch would position simple_amp to use the render pipeline and allow for metatags to be put into its pages nicely.

πŸ“Œ Task
Status

Fixed

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.69.0 2024