Add rel="amphtml" to head - any tips?

AI-generated summary

A user, Bcat, seeks advice on adding a rel="amphtml" link to the <head> of their Discourse site to support AMP for news and blog articles, aiming to improve load times and search results Bcat. They have created AMP versions of their pages, such as amp.domain.com/blog/123456, and want to link them properly. However, codinghorror warns that AMP is incompatible with JavaScript-based apps like Discourse and suggests that implementing AMP would require rewriting Discourse from scratch, recommending a different open-source platform if AMP is essential codinghorror.

I don’t like the way the administrator is discussing the issue, I see him abusing his authority.
This is my personal opinion anyway, I have no intention of changing this source code.

I want to implement AMP for my discourse!

I have created a template with url like: amp.domain.com/blog/123456
example: https://voucher.com.vn/dev/blog/846 or https://voucher.com.vn/dev/blog/844

only mobile: Redirect Notice

And now I’m looking for a way to insert the above url into the to declare the AMP page.

example: <head> ... <link rel="amphtml" href="https://voucher.com.vn/dev/blog/846"> ... </head>

Can someone help me with how to do it?

Why? AMP isn’t really compatible with JavaScript apps like discourse. Amp is for relatively static news and blog web pages, not apps.

Because the page was created to create news articles, blogs.
Should optimize the load as well as search results is an optimal choice.

I am afraid that would require completely rewriting Discourse from scratch, as in making it no longer a JavaScript app — if you really need amp that badly, choose a different free open source software.