Open hvelarde opened 8 years ago
These are my findings in Validating AMP pages : 1.Command Line tool 2.amphtml-validator 3.gulp-amphtml-validator
My comments about references:
So, all the magic happen just in reference number 2, and to integrate with Plone we can follow something like what we did at collective.behavior.featuredimage 1, 2, 3 where we add phanthomjs binary in the environment and call it from python, the only difference is that we need to call the validator command and read the output to show the errors, what can be done with subprocess module.
I found an easier solution using Cloudflare's AMP linter API.
please create an event subscriber and bind it to the creation and modification events to check the AMP output using this service; if the code is not valid we should display a warning to the user.
It would be nice to run validation in CI.
See: https://www.ampproject.org/docs/guides/validate.html