{{< gbook isbn="1932234411" >}}
Created
December 31, 2019 08:51
-
-
Save shindakun/0489695d373b41983dcf5e5637795ec3 to your computer and use it in GitHub Desktop.
Hugo Gbook Shortcode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{ $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