Skip to content

Instantly share code, notes, and snippets.

@yiping-allison
Last active May 5, 2020 06:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yiping-allison/d60cee80314d0669b18cfcc6b5f78e3f to your computer and use it in GitHub Desktop.
Save yiping-allison/d60cee80314d0669b18cfcc6b5f78e3f to your computer and use it in GitHub Desktop.
Simple Prodibi Shortcode for Hugo

Prodibi Shortcode

Designed For: George Cushen's Academic Theme

{{ if .Get "style" | eq "grid" }}
	<div data-prodibi='{"type":"grid","settings":{"container":"{{ .Get "containerID" }}","account":"{{ .Get "username" }}"}}'>
		<script>;!function() {if (window.prodibiAsync == null) { var s = document.createElement('script'); s.async = !0; s.src = 'https://max1.prodibicdn.com/libraries/pages/prodibi.embed.2.0.min.js'; document.body.appendChild(s); }window.prodibiAsync = window.prodibiAsync || [];prodibiAsync.push({ type: "settings", settings: { account: "{{ .Get "username" }}" } });}();</script>
	</div>
{{ else if .Get "style" | eq "album" }}
	<canvas data-prodibi='{"type":"thumbnailMediaView","settings":{"cover":{"heightMode":"aspectRatio"},"container":"{{ .Get "containerID" }}","account":"{{ .Get "username" }}"}}'>
		<script>;!function() {if (window.prodibiAsync == null) { var s = document.createElement('script'); s.async = !0; s.src = 'https://max1.prodibicdn.com/libraries/pages/prodibi.embed.2.0.min.js'; document.body.appendChild(s); }window.prodibiAsync = window.prodibiAsync || [];prodibiAsync.push({ type: "settings", settings: { account: "{{ .Get "username" }}" } });}();</script>
	</canvas>
{{ end }}

Usage: {{< prodibi style="grid" containerID="[albumID]" username="[prodibiUserName]" >}}

containerID is the ID of the album found on the website. username is the account name of the Prodibi user.

The shortcode has two style options:

  • grid - Pinterest style gallery option
  • album - Single image per page

If the images do not load/render, then there might be an issue with your Prodibi gallery settings or shortcode usage error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment