Hi, I just stumbled over the Google AMP project and wanted to integrate it in Kirby. The implementation as such seems relatively easy (tags, template etc.) but I’m not sure how to best generate it in Kirby.
I guess it could be achieved via routes, so that the head tag required by Google AMP <link rel="amphtml" href="http://site/blog/slug-comes-here/amp"> will be referring to the AMP url and the specific AMP template will be used. I’ve never used routes and wondered how to load a specific template when /amp is added as a suffix to the url. I tried following but it somehow doesn’t work. Any hints appreciated…
Hi, thanks for your reply. Just tested it, getting a 500 server error. I added your code to the config.php, the amp.php is also in place, and I have regular access to the blog entries.
Just a short follow-up question… If I want to define a second route, the previous one doesn’t seem to work any longer. I just wanted to use a second route to get a print version of the particular page (loading print.php). Both versions work like a charm, but not at the same time since I guess the first gets overruled when I define the routes separately, like below. I also tried to pass on the second array into the first but c::set but didn’t succeed. I guess it’s again a tiny detail I’m missing here…
dudes theres a lot of last reply, i’m newbie in this, im just finding another light cms, kirby runns very well, and sorry my poor english (i talk spanish), so I’ll be direct, i’ve done all that you have cleared up, i need a cms with amp generator so, it doesnt work running kirby 2.5.2 and php 5.6, and cant make that works.
this is the url: http://gaared.com/kirby/
I also came up with Google AMP recently and saw this article. I understand what is done here with the routing but I don’t know if I get it right but I wanna achieve that on every page the “amp-head” is added automatically. I did not understand how this is able with the above routes. Do I miss something?
For Example I have the following pages:
startpage
blog
products
news
about us
sign up
Now for most of the pages I have the same header snippet. Is it easily possible to change that header snippet when going to /amp instead of / or /blog/amp instead of /blog?