Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
42 lines (27 sloc) 866 Bytes
{{/*
Embed a pen from codepen.io
The only required parameter is `id`.
It's the slug-hash of the pen. Get it from the url.
For other parameters and their default see below.
Overwrite them to your needs.
Examples:
- Simple:
{{% pen id="Gflmy" %}}
- Show pen in js tab:
{{% pen id="Gflmy" tab="js" %}}
*/}}
{{/* DEFAULTS */}}
{{ $user := "jorin" }}
{{ $height := 500 }}
{{ $tab := "result" }}{{/* html|css|js|result */}}
{{ $theme := 8862 }}{{/* create on codepen.io */}}
<script
data-slug-hash="{{ .Get "id" }}"
data-user="{{ or (.Get "user") $user }}"
data-height="{{ or (.Get "height") $height }}"
data-default-tab="{{ or (.Get "tab") $tab }}"
data-theme-id="{{ or (.Get "theme") $theme }}"
class='codepen'
async
src="//codepen.io/assets/embed/ei.js"
></script>