AMP for custom pages

Hi,

I’m trying to see if there is a way to create an AMP version of a custom page or homepage. I’m just wondering if it is feasible. Here is what I came up with:

<!DOCTYPE html>

{{#is "page"}}
    {{#post}}
        {{#has slug="welcome"}}
            <html ⚡>
                <head>
                    <!-- Manually add meta data in here -->
                    <!-- Manually add <style amp-custom> -->
                    <script async src="https://cdn.ampproject.org/v0.js"></script>
                    <script async custom-element="amp-anim" src="https://cdn.ampproject.org/v0/amp-anim-0.1.js"></script>
                </head>
                <body class="amp-template">
        {{else}}
            <html lang="{{lang}}">
                <head>
                    {{> theme_head}}

                    {{!-- Ghost outputs important style and meta data with this tag --}}
                    {{ghost_head}}

                    <!-- Manually add this meta tag in Code Injection for this page -->
                    <link rel="amphtml" href="http://localhost:2369/welcome/amp/" />

                </head>
                <body class="{{body_class}} nav-closed">
        {{/has}}
    {{else}}
        <!-- Fix other posts -->
    {{/post}}
{{/is}}

I know that this is an ugly way to do it. I’m just curios if this is possible or if AMP needs something more to work. What do you think?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.