fix readme in .github not found
This commit is contained in:
parent
2ff2b9c2af
commit
2ac8821306
1 changed files with 8 additions and 2 deletions
|
@ -1,7 +1,12 @@
|
||||||
{{ $repo := .Get "repo" }}
|
{{ $repo := .Get "repo" }}
|
||||||
{{ $url := printf "https://api.github.com/repos/night0721/%s/contents/README.md" $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 $url }}
|
{{ $response := getJSON $rootReadmeURL }}
|
||||||
|
|
||||||
|
{{ if not (isset $response "content") }}
|
||||||
|
{{ $response = getJSON $githubDirReadmeURL }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
{{ with $response }}
|
{{ with $response }}
|
||||||
{{ if isset . "content" }}
|
{{ if isset . "content" }}
|
||||||
|
@ -16,3 +21,4 @@
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<p>Error fetching data from GitHub API.</p>
|
<p>Error fetching data from GitHub API.</p>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue