Skip to content

Instantly share code, notes, and snippets.

@jnutterdev
Last active January 19, 2022 18:18
Show Gist options
  • Save jnutterdev/d8977c086d7aed375287128de270e68f to your computer and use it in GitHub Desktop.
Save jnutterdev/d8977c086d7aed375287128de270e68f to your computer and use it in GitHub Desktop.
Bandcamp shortcode for embedding an album or track to a markdown file
<!--
Bandcamp shortcode intended for Hugo. This will be placed in the layouts/shortcodes folder in your project.
Parameters:
type - (Required) `album` or `track`
id - (Required) Target ID of track or album
size - (Optional) size of player, `large` or `small`
bgcol - (Optional) background color of player, `black` or `white`. default `white`.
linkcol - (optional) link colors, default black. all color options:
blue = 0687f5
orange = e99708
green = 2ebd35
purple = 7137dc
pink = f171a2
lblue = 63b2cc
red = de270f
darkgrey = 333333
tracklist - (optional) display tracks, default false
artwork - (optional) size of artwork, large or small default small
Example markdown code:
{{< bandcamp id="3715311508" bgcol="000000" linkcol="63b2cc" size="large" tracklist="true" >}}
-->
<iframe style="border: 0; width: 100%; height: 120px;"
src="https://bandcamp.com/EmbeddedPlayer
/album={{ .Get "id" }}
/size={{ default "small" (.Get "size") }}
/bgcol={{ default "ffffff" (.Get "bgcol") }}
/linkcol={{ default "000000" (.Get "linkcol") }}
/tracklist={{ default "false" (.Get "tracklist") }}
/artwork={{ default "small" (.Get "artwork") }}
/transparent=true/"></iframe>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment