-
-
Notifications
You must be signed in to change notification settings - Fork 378
Description
Feature Description
It would be great if Hextra supported adding polls to markdown.
Problem/Solution
This would give authors of a site the ability to introduce some interactivity to their site and gather information about the people reading their content.
A simple solution would be adding a partial/shortcode combo for embedding a strawpoll like so:
e.g.
layouts/_partials/_shortcodes/strawpoll.html
{{ $id := .id }}
<div class="strawpoll-embed" id="strawpoll_{{- $id -}}" style="height: 544px; max-width: 640px; width: 100%; margin: 0 auto; display: flex; flex-direction: column;">
<iframe title="StrawPoll Embed" id="strawpoll_iframe_{{- $id -}}" src="https://strawpoll.com/embed/{{ $id }}" style="position: static; visibility: visible; display: block; width: 100%; flex-grow: 1;" frameborder="0" allowfullscreen allowtransparency>
Loading...
</iframe>
<script async src="https://cdn.strawpoll.com/dist/widgets.js" charset="utf-8"></script>
</div>layouts/_shortcodes/strawpoll.html
{{- $id := .Get "id" | default "" -}}
{{ partial "shortcodes/strawpoll.html" (dict "id" $id) }}Alternatives Considered
I did have a look to see if there would be a way of using github backed polls in the same way that hextra uses giscus for comments that are backed by github discussions. But it seems like the API for github discussions doesn't support polls yet? If I am wrong however, then perhaps using github discussions for polls would be a better idea.