schnack icon indicating copy to clipboard operation
schnack copied to clipboard

Embed schnack inside iframe for Hugo AMP site

Open roshanjonah opened this issue 3 years ago • 0 comments

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?

roshanjonah avatar Jun 16 '21 23:06 roshanjonah