Re: AMP pages with Tapestry

"Thiago H. de Paula Figueiredo" <[email protected]>
Newsgroups gmane.comp.java.tapestry.user
Message-ID <CAE_88GbftRyCyYnfGasTtFvUkHqM3iKmYiVomhMUF=mPPy+MCA@mail.gmail.com>
On Tue, Nov 29, 2016 at 6:36 PM, Carlos Montero Canabal <
[email protected]> wrote:

> Hello Tapestry users,
>

Hi!


>
> I would like to create an amp version of my pages into a tapestry5.4
> webapp. According to https://www.ampproject.org/
> docs/reference/spec#required-markup <https://www.ampproject.org/
> docs/reference/spec#required-markup> the root html only would be:
>
> <html amp>
>
> Tapestry5 make a xhtml compilation for the .tml, so I ask you if there is
> any method to:
>

That's not correct. Tapestry 5 uses an XML parser for template files, and
attributes without values aren't valid XML. You can try <html amp="amp">.


> 1. Exclude de xhtml compilation for this pages
> 2. Intercept the result and modify it to eliminate additional tags added
> by Tapestry.
> 3. Create a MarkupModel for AMPHtml?
>

Number 3 above is probably the best idea. You'll need to override the
MarkupWriterFactory so you can use your AmpMarkupModel.

--
Thiago
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.