Skip to content

Instantly share code, notes, and snippets.

@j-un
Last active November 3, 2025 11:30
Show Gist options
  • Select an option

  • Save j-un/e7d0b3118556479392bd2269f7059242 to your computer and use it in GitHub Desktop.

Select an option

Save j-un/e7d0b3118556479392bd2269f7059242 to your computer and use it in GitHub Desktop.

Revisions

  1. j-un revised this gist Oct 29, 2020. 1 changed file with 8 additions and 0 deletions.
    8 changes: 8 additions & 0 deletions spotify.html
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,11 @@
    <!--
    Parameters:
    type - (Required) album / track / playlist / artist
    id - (Required) Target ID
    width - (Optional) width
    height - (Optional) height
    -->

    {{ if .IsNamedParams }}
    <iframe src="https://open.spotify.com/embed/{{ .Get "type" }}/{{ .Get "id" }}"
    width="{{ default "100%" (.Get "width") }}"
  2. j-un revised this gist Oct 29, 2020. No changes.
  3. j-un revised this gist Oct 29, 2020. No changes.
  4. j-un revised this gist Oct 29, 2020. No changes.
  5. j-un revised this gist Oct 29, 2020. 1 changed file with 4 additions and 8 deletions.
    12 changes: 4 additions & 8 deletions spotify.html
    Original file line number Diff line number Diff line change
    @@ -1,19 +1,15 @@
    {{ if .IsNamedParams }}
    <iframe
    src="https://open.spotify.com/embed/{{ .Get "type" }}/{{ .Get "id" }}"
    <iframe src="https://open.spotify.com/embed/{{ .Get "type" }}/{{ .Get "id" }}"
    width="{{ default "100%" (.Get "width") }}"
    height="{{ default "380" (.Get "height") }}"
    frameborder="0"
    allowtransparency="true"
    allow="encrypted-media"
    ></iframe>
    allow="encrypted-media"></iframe>
    {{ else }}
    <iframe
    src="https://open.spotify.com/embed/{{ .Get 0 }}/{{ .Get 1 }}"
    <iframe src="https://open.spotify.com/embed/{{ .Get 0 }}/{{ .Get 1 }}"
    width="{{ default "100%" (.Get 2) }}"
    height="{{ default "380" (.Get 3) }}"
    frameborder="0"
    allowtransparency="true"
    allow="encrypted-media"
    ></iframe>
    allow="encrypted-media"></iframe>
    {{ end }}
  6. j-un created this gist Oct 29, 2020.
    19 changes: 19 additions & 0 deletions spotify.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    {{ if .IsNamedParams }}
    <iframe
    src="https://open.spotify.com/embed/{{ .Get "type" }}/{{ .Get "id" }}"
    width="{{ default "100%" (.Get "width") }}"
    height="{{ default "380" (.Get "height") }}"
    frameborder="0"
    allowtransparency="true"
    allow="encrypted-media"
    ></iframe>
    {{ else }}
    <iframe
    src="https://open.spotify.com/embed/{{ .Get 0 }}/{{ .Get 1 }}"
    width="{{ default "100%" (.Get 2) }}"
    height="{{ default "380" (.Get 3) }}"
    frameborder="0"
    allowtransparency="true"
    allow="encrypted-media"
    ></iframe>
    {{ end }}