{{ $repo := .Get "repo" }} {{ $rootReadmeURL := printf "https://api.github.com/repos/night0721/%s/contents/README.md" $repo }} {{ $githubDirReadmeURL := printf "https://api.github.com/repos/night0721/%s/contents/.github/README.md" $repo }} {{ $response := getJSON $rootReadmeURL }} {{ if not (isset $response "content") }} {{ $response = getJSON $githubDirReadmeURL }} {{ end }} {{ with $response }} {{ if isset . "content" }} {{ $content := .content | base64Decode }} {{ $markdown := $content | markdownify }}
Error fetching README from GitHub.
{{ end }} {{ else }}Error fetching data from GitHub API.
{{ end }}