route to stagit instead of dynamic readme

This commit is contained in:
Night Kaly 2024-03-30 01:39:42 +00:00
parent f4497698bf
commit bd8d077e99
No known key found for this signature in database
GPG key ID: 8E829D3381CFEBBE
13 changed files with 2 additions and 88 deletions

View file

@ -18,8 +18,8 @@ ignoreErrors = ["error-remote-getjson"]
weight = 20 weight = 20
[[menu.main]] [[menu.main]]
name = "Repos" name = "Git"
url = "/repos" url = "https://git.night0721.xyz"
weight = 30 weight = 30
[[menu.main]] [[menu.main]]

View file

@ -1,6 +0,0 @@
---
title: "Repositories"
description: "Documentation for my projects"
---
{{< repolist >}}

View file

@ -1,5 +0,0 @@
---
title: "auth"
description: "Documentation of auth"
---
{{<getreadme repo="auth">}}

View file

@ -1,5 +0,0 @@
---
title: "based"
description: "Documentation of based"
---
{{<getreadme repo="based">}}

View file

@ -1,5 +0,0 @@
---
title: "cath"
description: "Documentation of cath"
---
{{<getreadme repo="cath">}}

View file

@ -1,5 +0,0 @@
---
title: "ccc"
description: "Documentation of ccc"
---
{{<getreadme repo="ccc">}}

View file

@ -1,5 +0,0 @@
---
title: "Lilase"
description: "Documentation of Lilase"
---
{{<getreadme repo="lilase">}}

View file

@ -1,5 +0,0 @@
---
title: "noted"
description: "Documentation of noted"
---
{{<getreadme repo="noted">}}

View file

@ -1,5 +0,0 @@
---
title: "nxc-host"
description: "Documentation of nxc-host"
---
{{<getreadme repo="nxc-host">}}

View file

@ -1,5 +0,0 @@
---
title: "NYX"
description: "Documentation of NYX"
---
{{<getreadme repo="cath.exe">}}

View file

@ -1,5 +0,0 @@
---
title: "rush"
description: "Documentation of rush"
---
{{<getreadme repo="rush">}}

View file

@ -1,23 +0,0 @@
{{ $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 }}
<div class="readme-content">
{{ $markdown | safeHTML }}
</div>
{{ else }}
<p>No README found for the repository.</p>
{{ end }}
{{ else }}
<p>Error fetching README from GitHub.</p>
{{ end }}

View file

@ -1,12 +0,0 @@
<ul>
{{ $files := readDir "content/repos" }}
{{ range $files }}
{{ $fileNameParts := split .Name "." }}
{{ $fileName := index $fileNameParts 0 }}
{{ if ne $fileName "_index" }}
<li>
<a href="/repos/{{ $fileName }}">{{ $fileName }}</a>
</li>
{{ end }}
{{ end }}
</ul>