1
Fork 0
theorangeone.net-legacy/layouts/shortcodes/gist.html

18 lines
513 B
HTML
Raw Permalink Normal View History

2017-07-09 21:55:23 +01:00
{{ $id := default (.Get 0) .Page.Params.gist }}
2017-07-04 09:42:44 +01:00
{{ $data := getJSON "https://api.github.com/gists/" $id }}
2017-09-30 22:18:21 +01:00
2018-05-06 17:54:56 +01:00
<div class="gist">
{{ range $i, $e := $data.files }}
<h5 class="mb-0">
<a href="{{ $data.html_url }}#file-{{ $i }}">
<code class="font-weight-bold pl-2">{{ $i }}</code>
</a>
&nbsp;&nbsp;
<a href="{{ $e.raw_url }}">
<small class="font-italic">View Raw</small>
</a>
</h5>
{{ highlight $e.content $e.language "linenos=inline" }}
{{ end }}
</div>