Skip to content

Instantly share code, notes, and snippets.

@encarsia
Created November 29, 2019 16:29
Show Gist options
  • Save encarsia/6c63d9433b05878b7c751036a903f8d0 to your computer and use it in GitHub Desktop.
Save encarsia/6c63d9433b05878b7c751036a903f8d0 to your computer and use it in GitHub Desktop.
Pixelfed shortcode for Nikola (Mako template)
<%doc>
Template engine: Mako
Usage:
{{% pixelfed status=https://instance.domain/p/user/postnr %}}
Optional parameters:
width (default: 400)
Example: {{% pixelfed status=https://instance.domain/p/user/postnr % width=500}} will show a frame of 500 px width instead of the default 400
</%doc>
% if width is UNDEFINED:
<% w = 400 %>
% else:
<% w = width %>
% endif
<iframe src="${status}/embed?caption=true&likes=false&layout=full" class="pixelfed__embed" style="max-width: 100%; border: 0" width=${w} allowfullscreen="allowfullscreen"></iframe><script async defer src="https://pixelfed.social/embed.js"></script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment