Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Hugo Gbook Shortcode

{{< gbook isbn="1932234411" >}}

{{ $isbn := printf "%s%s" "?q=isbn:" .Params.isbn }}
{{ $urlPre := "https://www.googleapis.com/books/v1/volumes" }}
{{ $gistJ := getJSON $urlPre $isbn }}
{{ $i := index $gistJ.items 0 }}
<img src="{{ $i.volumeInfo.imageLinks.thumbnail }}" />
{{ $i.volumeInfo.title }} <br>
{{ $i.volumeInfo.authors }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.