I was wondering how to implement dynamic AMP pages with Lift.
Lift.js causes invalid AMP page. Did anyone has successfully managed that?
Another solution cloud be to generate plain html with a cron job.
Thanks,
Andrea
--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code
---
You received this message because you are subscribed to the Google Groups "Lift" group.
To unsubscribe from this group and stop receiving emails from it, send an email to liftweb+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
What about the lift JS file is incompatible with AMP? 5$3 fact that it isn't marked async?
Thanks,
Antonio
Hi Andrea
You probably need to relax the security
rules in lift boot, take a look at the
CSP rules at LiftRules.securityRules in lift boot or even
do a github search about it [1].
On a second note whats up with the html tag in [2] it has some
strange unicode sign in it ?
I would actually fix that first cause I am not sure lifts CSP
affects stuff living in /static
[1]
https://github.com/search?q=LiftRules.securityRules&type=Code&utf8=%E2%9C%93
[2]
https://github.com/zaza81/AMP-test/blob/master/src/main/webapp/static/amp-sample.html
best regards Peter Petersson
--
Thanks.
I am trying to create AMP pages: https://www.ampproject.org/learn/about-amp/
The HTML is correct. I am Just wondering how create Dynamic AMP pages, as custom js are not allowed.
Google is ranking a lot better amp pages, so i am trying to translate around 2M pages :-)
A.
Okey thanks for the link it explains the opening html tag.
So what you are saying is that you are not "allowed" to deploy the AMP
page on google if it contains custom js ?
Well, net-net, Lift relies on the JS to do certain aspects of state managementlike ensuring the functions tied to form fields stay alive on the server. However,you might be able to respond to renders from a search engine user agent witha page that doesn't carry that JS, since it's not expected that it will need thosefunctions, or certain pages that you know don't require that binding stuff. Youcan also try reworking your forms not to use function binding.
I'm not sure if this is actually what you're using. If you're not using any server-side function binding (like anything in SHtml.*), for a given page, you can alwaystweak `LiftRules.autoIncludeAjaxCalc` and `LiftRules.javaScriptSettings` tobe false and empty, respectively, for the pages you want. You can do this in anearly function, I believe:LiftRules.early.append { (request: HTTPRequest) =>if (request.uri.contains("/amp/")) {LiftRules.autoIncludeAjaxCalc.request.set(() => (_: LiftSession) => false)LiftRules.javaScriptSettings.request.set(() => Empty)}}It may have to be in `LiftRules.onBeginServicing` instead, don't have time togive it a trial run right this second unfortunately.Thanks,Antonio
--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code
---
You received this message because you are subscribed to the Google Groups "Lift" group.
To unsubscribe from this group and stop receiving emails from it, send an email to liftweb+unsubscribe@googlegroups.com.
Thanks for your help, I will make a sample project with AMP pages working, so to share.
a.