add repos main page and to menu
This commit is contained in:
parent
5772007454
commit
81d846f0d2
13 changed files with 28 additions and 4 deletions
11
config.toml
11
config.toml
|
@ -17,20 +17,25 @@ ignoreErrors = ["error-remote-getjson"]
|
|||
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
5
content/repos/_index.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: "Repositories"
|
||||
---
|
||||
|
||||
{{< repolist >}}
|
|
@ -4,6 +4,8 @@
|
|||
|
||||
{{ .Content }}
|
||||
|
||||
{{ if eq .Section "posts" }}
|
||||
{{ partial "posts.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ partial "footer.html" . }}
|
||||
|
|
12
layouts/shortcodes/repolist.html
Normal file
12
layouts/shortcodes/repolist.html
Normal 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>
|
Loading…
Reference in a new issue