diff --git a/exampleSite/content/docs/shortcodes/index.md b/exampleSite/content/docs/shortcodes/index.md index 1e06aa6b..44a0f06d 100644 --- a/exampleSite/content/docs/shortcodes/index.md +++ b/exampleSite/content/docs/shortcodes/index.md @@ -390,9 +390,10 @@ In order to add images to the gallery, use `img` tags for each image and add `cl `github` allows you to quickly link a github repository, all while showing and updating in realtime stats about it, such as the number of stars and forks it has. -| Parameter | Description | -| --------- | ----------------------------------------------------- | -| `repo` | [String] github repo in the format of `username/repo` | +| Parameter | Description | +|-----------------|---------------------------------------------------------------| +| `repo` | [String] github repo in the format of `username/repo` | +| `showThumbnail` | **Optional** [boolean] display a thumbnail for the repository | **Example 1:** diff --git a/layouts/shortcodes/github.html b/layouts/shortcodes/github.html index 484d7e90..7abb47a8 100644 --- a/layouts/shortcodes/github.html +++ b/layouts/shortcodes/github.html @@ -2,13 +2,20 @@ {{- $githubURL := print "https://api.github.com/repos/" (.Get "repo") -}} {{- $githubData := resources.GetRemote $githubURL | transform.Unmarshal -}} {{- $githubColors := .Site.Data.githubColors -}} -{{- with $githubData -}} +{{- $githubThumbnailURL := print "https://opengraph.githubassets.com/0/" (.Get "repo") -}}