Skip to content

Embed schnack inside iframe for Hugo AMP site #138

@roshanjonah

Description

@roshanjonah

Trying to embed Schnack into a Hugo site that is using AMP. As you know with AMP, the only possibility of embedding comments is via iframes. Currently, I am using Disqus and my iframe code looks something like this...

{{ with .Params.Author }}
    <amp-iframe width=600 height=180
        layout="responsive"
        sandbox="allow-scripts allow-same-origin allow-modals allow-popups allow-forms"
        resizable
        src="{{ $.Site.Params.commentsEmbedUrl }}?id={{ .File.UniqueID }}&url={{ .Permalink }}">
        <div overflow
            tabindex=0
            role=button
            aria-label="Load more"
            style="display:block;font-size:14px;font-weight:500;text-align:center;line-height:1.1;padding:12px 16px;border-radius:4px;background:rgba(29,47,58,0.6);color:rgb(255,255,255)">
            Load more
        </div>
    </amp-iframe>
{{ end }}

?id={{ .File.UniqueID }}&url={{ .Permalink }} - Both these are populated. How do I do something like this for Schnack? Does it support iframes?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions