add repos main page and to menu

This commit is contained in:
Night Kaly 2024-03-14 01:11:51 +00:00
parent 5772007454
commit 81d846f0d2
No known key found for this signature in database
GPG key ID: 8E829D3381CFEBBE
13 changed files with 28 additions and 4 deletions

View file

@ -16,21 +16,26 @@ ignoreErrors = ["error-remote-getjson"]
name = "Posts"
url = "/posts"
weight = 20
[[menu.main]]
name = "Repos"
url = "/repos"
weight = 30
[[menu.main]]
name = "Contact"
url = "/contact"
weight = 30
weight = 40
[[menu.main]]
name = "Links"
url = "/links"
weight = 40
weight = 50
[[menu.main]]
name = "Bookmarks"
url = "/bookmarks"
weight = 50
weight = 60
[[menu.social]]
name = "Codeberg"

5
content/repos/_index.md Normal file
View file

@ -0,0 +1,5 @@
---
title: "Repositories"
---
{{< repolist >}}

View file

@ -4,6 +4,8 @@
{{ .Content }}
{{ partial "posts.html" . }}
{{ if eq .Section "posts" }}
{{ partial "posts.html" . }}
{{ end }}
{{ partial "footer.html" . }}

View file

@ -0,0 +1,12 @@
<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>