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

No README found for the repository.

{{ end }} {{ else }}

Error fetching README from GitHub.

{{ end }}