18 lines
508 B
HTML
18 lines
508 B
HTML
{{ $repo := .Get "repo" }}
|
|
{{ $url := printf "https://api.github.com/repos/night0721/%s/contents/README.md" $repo }}
|
|
|
|
{{ $response := getJSON $url }}
|
|
|
|
{{ with $response }}
|
|
{{ if isset . "content" }}
|
|
{{ $content := .content | base64Decode }}
|
|
{{ $markdown := $content | markdownify }}
|
|
<div class="readme-content">
|
|
{{ $markdown | safeHTML }}
|
|
</div>
|
|
{{ else }}
|
|
<p>Error fetching README from GitHub.</p>
|
|
{{ end }}
|
|
{{ else }}
|
|
<p>Error fetching data from GitHub API.</p>
|
|
{{ end }}
|