Google AMP Support?

I am interested to hear if (and how) Grav can support Google Accelerated Mobile Pages (AMP). Is this ‘just’ a matter of creating a theme to support this, will a plugin be needed, need something to be done in the core?

Since some others asked the same questions already. I think one should shed light on Google AMP. Google AMP uses special marked up HTML and restricts the site builder to only a few web elements. Thus, in principle writing an AMP theme is enough. However, since AMP uses different markup for image, video and embed tags (see ), you need at least a plugin (or a shortcode extension), which “converts” the standard HTML form of images, videos etc. into the AMP format. Roughly, speaking this can be done, without touching the core, but you can open an issue for your request.

There is only one thing, which remains: Why using Google AMP? Well, the main reason is that you already have a big site bloated of with a lot of JS (page load with >1MB) and you now want a fast website back. If you carefully craft your website and only use those libraries/functions/features you really use, then your website is automatically fast, without sticking to any third-party library or a hosting service . After all your pages are cached on a Google server for AMP, but you can do the same with a CDN of your choice.

All in all, I see no reason to use AMP for the moment. Clearly, it has advantages, but the price you pay is restriction of yourself. Better design a website/theme which is fast (and accessible) for everyone and not only for a small minority.

Grav can help you out here. It is fast by design and with the right plugins, you have the flexibility of a CMS with the speed of static webpages :wink:

After I have optimized the crap out of my images, another technique I use to provide a faster experience for mobile is to skip over larger content in my templates when the user platform is not mac or windows. My background video won’t autoplay on mobile anyways so I don’t send it.

   // Larger content for laptop/desktop, such as massive images or autoplay videos
{% else %}
   // Lighter content for mobile
{% endif %}```

Bring this one back to life. This question by @Sommerregen was an eye catching.

Why using Google AMP?

The same applies to:

Why using Facebook Instant Articles
Why using Apple News Format

The answer could lead to more severe consequences than browser wars did (and still does). That war is about technology, this one is about the publishing market, the content itself. The winner (or winners) takes a whole bunch of publishers that should publish on its format so the content becomes relevant.

I see no reason why Grav should devs should hold themselves back on this accelerated thing party. Yes, a carefully crafted site is fast enough, but it’s just not a contender for a fast site with an :zap: version too. Search engine or the distribution platform will give an :zap: page extra points over a just as fast one with non :zap: page.

Those extra points, my dear friends, those are what they call a market.

Oh, BTW this guy PageFrog does AMP, FBIA and ANF for any WordPress enabled site. I haven’t used it (I’m on Automattic AMP one), but it looks quite engaging.

Grav could easily go on that route…

The problem is that this technology changes, and new stuff comes and goes. I’d personally prefer that the actual developers focus on creating the fastest and most stable CMS they can and leave AMP et al. as the front-end cruft that it is. Theme and plugin developers can add support for such things if they want them. Grav themes are actually quite powerful. I would just hate to see limited Team Grav resources spent on this sort of thing when there are things like the Admin plugin (which actually grows the user base) and API that still need work.

I see your point, @Perlkönig.

But hey, what a developers does beyond implement new techs over and over again? :wink:

There is certainly a plus for having AMP available, there are no plans to do it in the core, as the core is minimal and AMP is just a frontend presentation “thing” and the best way to add this integration is with a plugin, to make it transparent to the theme used to not reinvent the wheel

If you’re (or anyone) is willing to make a plugin, welcome! :slight_smile:

Yes, sir… I’m. :wink:

I just need to find the time to code it. :frowning:

Anyone a bit less busy?

Hi @denydias, my question wasn’t really intended to be an eyer catcher :wink: It was there to bring the discussion to the real things, which matter most, than just to present content. More specifically it addressed the habit that most websites are bloated with JS/CSS, are so big, and slow to deliver.

It, of course, does not address if you already have a fast site and you now want to distribute your content over more channels. As @flaviocopes said Grav Core is designed to be minimal and fast and an AMP plugin is doable. Thus, anyone is encourage to code it. Maybe there are two or more people here, who can do it together :slight_smile:

Sure thing, @Sommerregen! That was my trap by bringing this back to life: to join people around the matter.

Unfortunately I don’t have the time to code it alone. I can do it, but I’ll take quite long to get it done in the spare time. But I can definitively help anyone ho want to join the effort. :wink:

If anyone is still interested: I just released a first alpha version of a AMP-img plugin and skeleton template

Nice! Will check it out

Kudos, @krillko!