make forkof repos not look broken (fixes #122)

This commit is contained in:
Arya Kiran
2023-06-08 15:18:17 +08:00
parent 87fdbfba7e
commit 7da420482b
+31 -20
View File
@@ -74,27 +74,38 @@
{{ end }} {{ if .MainRepos }}
<div class="user-readme">
<h3>{{.PinOrPopular}} repositories</h3>
{{range .MainRepos}}
<a class="user-repo-card" href="{{.Link}}">
<p class="user-repo-header">{{.Name}} ({{.Type}})</p>
{{if .ForkOf}} Forked from: <a href="/{{.ForkOf}}">{{.ForkOf}}</a>
{{else}} {{end}} {{if .Desc}} {{if eq .Type "Gist"}}
<style>
pre {
white-space: pre-wrap;
word-wrap: break-word;
}
</style>
<pre> {{.Desc}} </pre>
{{range .MainRepos}} {{ if .ForkOf }}
<div class="user-repo-card">
{{else}}
<p class="">{{.Desc}}</p>
{{end}} {{else}} {{end}}
<p class="">
{{if .Stars}}⭐ {{.Stars}}{{else}}{{end}} {{if .Forks}} 🍴 {{.Forks}}
{{else}}{{end}} {{if .Lang}} 🗒️ {{.Lang}} {{else}}{{end}}
</p>
</a>
{{ end }}
<a class="user-repo-card" href="{{.Link}}">
{{end}} {{if .ForkOf}}
<p class="user-repo-header">
<a href="{{.Link}}">{{.Name}} ({{.Type}})</a>
</p>
{{else}}
<p class="user-repo-header">{{.Name}} ({{.Type}})</p>
{{end}} {{if .ForkOf}}
<p class="">Forked from: <a href="/{{.ForkOf}}">{{.ForkOf}}</a></p>
{{else}} {{end}} {{if .Desc}} {{if eq .Type "Gist"}}
<style>
pre {
white-space: pre-wrap;
word-wrap: break-word;
}
</style>
<pre> {{.Desc}} </pre>
{{else}}
<p class="">{{.Desc}}</p>
{{end}} {{else}} {{end}}
<p class="">
{{if .Stars}}⭐ {{.Stars}}{{else}}{{end}} {{if .Forks}} 🍴 {{.Forks}}
{{else}}{{end}} {{if .Lang}} 🗒️ {{.Lang}} {{else}}{{end}}
</p>
{{ if .ForkOf }} {{else}}
</a>
{{end}} {{ if .ForkOf }}
</div>
{{end}} {{ end }}
</div>
{{ end }} {{ end }} {{ else }}
<h2>User not found</h2>