add lucide icons
@@ -18,6 +18,10 @@ {{ template "layouts/topbar" . }}{{ end }}</header><main class="content">{{ block "content" . }}{{ end }}</main>+ <script src="/static/lucide.min.js"></script>+ <script>+ lucide.createIcons();+ </script></body></html>{{ end }}
@@ -2,8 +2,8 @@ {{ define "repoContent" }}{{ $lines := split .Contents }}{{ $tot_lines := len $lines }}{{ $tot_chars := len (printf "%d" $tot_lines) }}-{{ $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]" }}+{{ $code_number_style := "code-line-num text-gray-400 mr-2 px-1 sticky left-0 bg-white border-r border-black text-right" }}<pre class="font-mono text-sm overflow-auto relative text-ellipsis"><code>{{ range $idx, $line := $lines }}<span class="flex">- <span class="{{ $code_number_style }}">{{ add $idx 1 }}</span>+ <span class="{{ $code_number_style }}" style="min-width: {{$tot_chars}}ch;">{{ add $idx 1 }}</span><span class="whitespace-pre">{{ $line }}</span></span>{{ else }}<em class="text-gray-400">this file is empty</em>{{ end }}</code></pre>{{ end }}
@@ -5,14 +5,18 @@ {{- if .IsEmpty }}this repo is empty{{ else }}<div class="flex gap-4">- <div id="file-tree" class="w-2/3">+ <div id="file-tree" class="w-1/2">{{ $containerstyle := "py-1" }}{{ $linkstyle := "no-underline hover:underline" }}{{ range .Files }}{{ if not .IsFile }}<div class="{{ $containerstyle }}">- <a href="/{{ $.RepoInfo.FullName }}/tree/{{ $.Ref }}/{{ .Name }}" class="{{ $linkstyle }}">{{ .Name }}/</a>+ <a href="/{{ $.RepoInfo.FullName }}/tree/{{ $.Ref }}/{{ .Name }}" class="{{ $linkstyle }}">+ <div class="flex items-center gap-2">+ <i class="w-3 h-3 fill-current" data-lucide="folder"></i>{{ .Name }}/+ </div>+ </a></div>{{ end }}{{ end }}@@ -20,12 +24,16 @@{{ range .Files }}{{ if .IsFile }}<div class="{{ $containerstyle }}">- <a href="/{{ $.RepoInfo.FullName }}/blob/{{ $.Ref }}/{{ .Name }}" class="{{ $linkstyle }}">{{ .Name }}</a>+ <a href="/{{ $.RepoInfo.FullName }}/blob/{{ $.Ref }}/{{ .Name }}" class="{{ $linkstyle }}">+ <div class="flex items-center gap-2">+ <i class="w-3 h-3" data-lucide="file"></i>{{ .Name }}+ </div>+ </a></div>{{ end }}{{ end }}</div>- <div id="file-tree" class="flex-1">+ <div id="commit-log" class="flex-1">{{ range .Commits }}<div class="relative
MODIFIED
flake.lock
MODIFIED
flake.lock
@@ -48,6 +48,18 @@ "repo": "indigo","type": "github"}},+ "lucide-src": {+ "flake": false,+ "locked": {+ "narHash": "sha256-REXBOJhEp5BVrQ1lnIMYTd6+1vHfCtPKmc/dVtykGFg=",+ "type": "file",+ "url": "https://unpkg.com/lucide@latest"+ },+ "original": {+ "type": "file",+ "url": "https://unpkg.com/lucide@latest"+ }+ },"nixpkgs": {"locked": {"lastModified": 1738589849,@@ -68,6 +80,7 @@ "inputs": {"gitignore": "gitignore","htmx-src": "htmx-src","indigo": "indigo",+ "lucide-src": "lucide-src","nixpkgs": "nixpkgs"}}
MODIFIED
flake.nix
MODIFIED
flake.nix
@@ -11,6 +11,10 @@ htmx-src = {url = "https://unpkg.com/htmx.org@2.0.4/dist/htmx.min.js";flake = false;};+ lucide-src = {+ url = "https://unpkg.com/lucide@latest";+ flake = false;+ };gitignore = {url = "github:hercules-ci/gitignore.nix";inputs.nixpkgs.follows = "nixpkgs";@@ -22,6 +26,7 @@ self,nixpkgs,indigo,htmx-src,+ lucide-src,gitignore,}: letsupportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"];@@ -51,6 +56,7 @@ version = "0.1.0";src = gitignoreSource ./.;postConfigureHook = ''cp -f ${htmx-src} appview/pages/static/htmx.min.js+ cp -f ${lucide-src} appview/pages/static/lucide.min.js${pkgs.tailwindcss}/bin/tailwindcss -i input.css -o appview/pages/static/tw.css'';subPackages = ["cmd/appview"];
MODIFIED
knotserver/routes.go
MODIFIED
knotserver/routes.go
@@ -52,6 +52,9 @@ writeError(w, err.Error(), http.StatusInternalServerError)l.Error("fetching commits", "error", err.Error())return}+ if len(commits) > 10 {+ commits = commits[:10]+ }var readmeContent template.HTMLfor _, readme := range h.c.Repo.Readme {