Home

ugit @22cdff623a8ec2342b9f90cc60f4d66f0e7ec712 - refs - log -
-
https://git.jolheiser.com/ugit.git
The code powering this h*ckin' site
ugit / internal / html / repo.templ
- raw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package html

import "fmt"

type RepoHeaderComponentContext struct {
  Name string
  Ref string
  Description string
}

templ repoHeaderComponent(rhcc RepoHeaderComponentContext) {
	<div class="mb-1 text-text">
		<a class="text-lg underline decoration-text/50 decoration-dashed hover:decoration-solid" href={ templ.SafeURL("/" + rhcc.Name) }>{ rhcc.Name }</a>
		if rhcc.Ref != "" {
			{ " " }
			<a class="text-text/70 text-sm underline decoration-text/50 decoration-dashed hover:decoration-solid" href={ templ.SafeURL(fmt.Sprintf("/%s/tree/%s/", rhcc.Name, rhcc.Ref)) }>{ "@" + rhcc.Ref }</a>
		}
		{ " - " }
		<a class="underline decoration-text/50 decoration-dashed hover:decoration-solid" href={ templ.SafeURL(fmt.Sprintf("/%s/refs", rhcc.Name)) }>refs</a>
		{ " - " }
		<a class="underline decoration-text/50 decoration-dashed hover:decoration-solid" href={ templ.SafeURL(fmt.Sprintf("/%s/log/%s", rhcc.Name, rhcc.Ref)) }>log</a>
	</div>
	<div class="text-text/80 mb-1">{ rhcc.Description }</div>
}