+5
appview/pages/pages.go
+5
appview/pages/pages.go
···
50
return pairs, nil
51
},
52
"timeFmt": humanize.Time,
53
}
54
}
55
···
255
type RepoBlobParams struct {
256
LoggedInUser *auth.User
257
RepoInfo RepoInfo
258
types.RepoBlobResponse
259
}
260
261
func (p *Pages) RepoBlob(w io.Writer, params RepoBlobParams) error {
262
return p.executeRepo("repo/blob", w, params)
263
}
264
···
50
return pairs, nil
51
},
52
"timeFmt": humanize.Time,
53
+
"length": func(v []string) int {
54
+
return len(v)
55
+
},
56
}
57
}
58
···
258
type RepoBlobParams struct {
259
LoggedInUser *auth.User
260
RepoInfo RepoInfo
261
+
Active string
262
types.RepoBlobResponse
263
}
264
265
func (p *Pages) RepoBlob(w io.Writer, params RepoBlobParams) error {
266
+
params.Active = "overview"
267
return p.executeRepo("repo/blob", w, params)
268
}
269
+8
-11
appview/pages/templates/repo/blob.html
+8
-11
appview/pages/templates/repo/blob.html
···
1
{{ define "repoContent" }}
2
+
{{ $lines := split .Contents }}
3
+
{{ $tot_lines := len $lines }}
4
+
{{ $tot_chars := len (printf "%d" $tot_lines) }}
5
+
{{ $code_number_style := "code-line-num text-gray-400 mr-2 px-1 sticky left-0 bg-white border-r border-black text-right w-[{{$tot_chars}}rem]" }}
6
+
<pre class="font-mono text-sm overflow-auto relative text-ellipsis"><code>{{ range $idx, $line := $lines }}<span class="flex">
7
+
<span class="{{ $code_number_style }}">{{ add $idx 1 }}</span>
8
+
<span class="whitespace-pre">{{ $line }}</span></span>{{ else }}<em class="text-gray-400">this file is empty</em>{{ end }}</code></pre>
9
+
{{ end }}
+9
-17
flake.nix
+9
-17
flake.nix
···
54
${pkgs.tailwindcss}/bin/tailwindcss -i input.css -o appview/pages/static/tw.css
55
'';
56
subPackages = ["cmd/appview"];
57
-
vendorHash = "sha256-QgUPTOgAdKUTg+ztfs194G7pt3/qDtqTMkDRmMECxSo=";
58
env.CGO_ENABLED = 1;
59
stdenv = pkgsStatic.stdenv;
60
};
61
-
62
-
knotserver = with final;
63
final.pkgsStatic.buildGoModule {
64
-
pname = "knotserver";
65
-
version = "0.1.0";
66
-
src = gitignoreSource ./.;
67
-
subPackages = ["cmd/knotserver"];
68
-
vendorHash = "sha256-QgUPTOgAdKUTg+ztfs194G7pt3/qDtqTMkDRmMECxSo=";
69
-
env.CGO_ENABLED = 1;
70
-
nativeBuildInputs = with pkgsMusl; [ pkg-config ];
71
-
72
-
# Add these ldflags for static compilation
73
-
ldflags = [ "-s" "-w" "-linkmode external" ''-extldflags "-static -L${pkgsStatic.musl}/lib"'' ];
74
-
75
-
# Use static stdenv
76
-
stdenv = pkgMusl.stdenv;
77
-
};
78
};
79
packages = forAllSystems (system: {
80
inherit (nixpkgsFor."${system}") indigo-lexgen appview knotserver;
···
54
${pkgs.tailwindcss}/bin/tailwindcss -i input.css -o appview/pages/static/tw.css
55
'';
56
subPackages = ["cmd/appview"];
57
+
vendorHash = "sha256-t7lWrCyFWCI7zjUcC6XNWzCrUPSCFnFu9gTmRTsYrz0=";
58
env.CGO_ENABLED = 1;
59
stdenv = pkgsStatic.stdenv;
60
};
61
+
knotserver = with final;
62
final.pkgsStatic.buildGoModule {
63
+
pname = "knotserver";
64
+
version = "0.1.0";
65
+
src = gitignoreSource ./.;
66
+
subPackages = ["cmd/knotserver"];
67
+
vendorHash = "sha256-t7lWrCyFWCI7zjUcC6XNWzCrUPSCFnFu9gTmRTsYrz0=";
68
+
env.CGO_ENABLED = 1;
69
+
};
70
};
71
packages = forAllSystems (system: {
72
inherit (nixpkgsFor."${system}") indigo-lexgen appview knotserver;
+1
-1
go.mod
+1
-1
go.mod
···
10
github.com/bluesky-social/indigo v0.0.0-20250123072624-9e3b84fdbb20
11
github.com/bluesky-social/jetstream v0.0.0-20241210005130-ea96859b93d1
12
github.com/casbin/casbin/v2 v2.103.0
13
github.com/gliderlabs/ssh v0.3.5
14
github.com/go-chi/chi/v5 v5.2.0
15
github.com/go-git/go-git/v5 v5.12.0
···
37
github.com/cloudflare/circl v1.4.0 // indirect
38
github.com/cyphar/filepath-securejoin v0.3.3 // indirect
39
github.com/davecgh/go-spew v1.1.1 // indirect
40
-
github.com/dustin/go-humanize v1.0.1 // indirect
41
github.com/emirpasic/gods v1.18.1 // indirect
42
github.com/felixge/httpsnoop v1.0.4 // indirect
43
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
···
10
github.com/bluesky-social/indigo v0.0.0-20250123072624-9e3b84fdbb20
11
github.com/bluesky-social/jetstream v0.0.0-20241210005130-ea96859b93d1
12
github.com/casbin/casbin/v2 v2.103.0
13
+
github.com/dustin/go-humanize v1.0.1
14
github.com/gliderlabs/ssh v0.3.5
15
github.com/go-chi/chi/v5 v5.2.0
16
github.com/go-git/go-git/v5 v5.12.0
···
38
github.com/cloudflare/circl v1.4.0 // indirect
39
github.com/cyphar/filepath-securejoin v0.3.3 // indirect
40
github.com/davecgh/go-spew v1.1.1 // indirect
41
github.com/emirpasic/gods v1.18.1 // indirect
42
github.com/felixge/httpsnoop v1.0.4 // indirect
43
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect