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

16 lines
445 B
HTML
Raw 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
{{ range $i, $e := $data.files }}
<h5>
<a href="{{ $data.html_url }}#file-{{ $i }}">
2017-11-17 20:12:24 +00:00
<code class="font-weight-bold">{{ $i }}</code>
2017-09-30 22:18:21 +01:00
</a>
&nbsp;&nbsp;
<a href="{{ $e.raw_url }}">
2017-11-17 20:12:24 +00:00
<small class="font-italic">View Raw</small>
2017-09-30 22:18:21 +01:00
</a>
</h5>
2017-09-30 22:45:15 +01:00
{{ highlight $e.content $e.language "linenos=inline" }}
2017-09-30 22:18:21 +01:00
{{ end }}