ampproject / amphtml

The AMP web component framework.
https://amp.dev
Apache License 2.0
14.89k stars 3.88k forks source link

How to make AMP redundant? #10662

Closed panurag38 closed 6 years ago

panurag38 commented 6 years ago

I have made a static HTML page using amp boilerplate which contains details of a fruit product say apple, so my URL looks like www.xyz.com/apple

The page contains simple amp-carousel and some data with src relevant to apple.(product in route) which contains title as 'Apple', 3 images inside amp-img of amp-carousel, and an amp-list with src depending upon URL route/path.

Let I have other products whose details I want to show by changing route path to www.xyz.com/orange, www.xyz.com/pears, www.xyz.com/grapes etc.

Suppose If I want to keep it dynamic depending upon URL, say for www.xyz.com/orange my static page would now contain similar information, but relevant to URL param - ie... orange/pears/grapes

As the different product contains the different title, different no. of images for amp-list, amp-carousel or any simple list, how can I make my content dynamic for updated path in URL using ReactJS/ES6 syntax.

Also, provide any information about data flow/lifecycle methods for amp pages before HTML is made on the server(which I assume I am missing).

dvoytenko commented 6 years ago

@panurag38 Sounds like you want to have a server-side template (React or any other templating engine such as ExpressJS or even PHP) to render your pages based on the URL. AMP pages then will be independently cacheable by proxies.

(I'll close this for now, but feel free to reopen)