Monorepo for Tangled tangled.org

add lucide icons

Changed files
+40 -6
appview
pages
templates
knotserver
+4
appview/pages/templates/layouts/base.html
··· 18 18 {{ end }} 19 19 </header> 20 20 <main class="content">{{ block "content" . }}{{ end }}</main> 21 + <script src="/static/lucide.min.js"></script> 22 + <script> 23 + lucide.createIcons(); 24 + </script> 21 25 </body> 22 26 </html> 23 27 {{ end }}
+2 -2
appview/pages/templates/repo/blob.html
··· 2 2 {{ $lines := split .Contents }} 3 3 {{ $tot_lines := len $lines }} 4 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]" }} 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" }} 6 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> 7 + <span class="{{ $code_number_style }}" style="min-width: {{$tot_chars}}ch;">{{ add $idx 1 }}</span> 8 8 <span class="whitespace-pre">{{ $line }}</span></span>{{ else }}<em class="text-gray-400">this file is empty</em>{{ end }}</code></pre> 9 9 {{ end }}
+12 -4
appview/pages/templates/repo/index.html
··· 5 5 this repo is empty 6 6 {{ else }} 7 7 <div class="flex gap-4"> 8 - <div id="file-tree" class="w-2/3"> 8 + <div id="file-tree" class="w-1/2"> 9 9 {{ $containerstyle := "py-1" }} 10 10 {{ $linkstyle := "no-underline hover:underline" }} 11 11 12 12 {{ range .Files }} 13 13 {{ if not .IsFile }} 14 14 <div class="{{ $containerstyle }}"> 15 - <a href="/{{ $.RepoInfo.FullName }}/tree/{{ $.Ref }}/{{ .Name }}" class="{{ $linkstyle }}">{{ .Name }}/</a> 15 + <a href="/{{ $.RepoInfo.FullName }}/tree/{{ $.Ref }}/{{ .Name }}" class="{{ $linkstyle }}"> 16 + <div class="flex items-center gap-2"> 17 + <i class="w-3 h-3 fill-current" data-lucide="folder"></i>{{ .Name }}/ 18 + </div> 19 + </a> 16 20 </div> 17 21 {{ end }} 18 22 {{ end }} ··· 20 24 {{ range .Files }} 21 25 {{ if .IsFile }} 22 26 <div class="{{ $containerstyle }}"> 23 - <a href="/{{ $.RepoInfo.FullName }}/blob/{{ $.Ref }}/{{ .Name }}" class="{{ $linkstyle }}">{{ .Name }}</a> 27 + <a href="/{{ $.RepoInfo.FullName }}/blob/{{ $.Ref }}/{{ .Name }}" class="{{ $linkstyle }}"> 28 + <div class="flex items-center gap-2"> 29 + <i class="w-3 h-3" data-lucide="file"></i>{{ .Name }} 30 + </div> 31 + </a> 24 32 </div> 25 33 {{ end }} 26 34 {{ end }} 27 35 </div> 28 - <div id="file-tree" class="flex-1"> 36 + <div id="commit-log" class="flex-1"> 29 37 {{ range .Commits }} 30 38 <div class= 31 39 "relative
+13
flake.lock
··· 48 48 "type": "github" 49 49 } 50 50 }, 51 + "lucide-src": { 52 + "flake": false, 53 + "locked": { 54 + "narHash": "sha256-REXBOJhEp5BVrQ1lnIMYTd6+1vHfCtPKmc/dVtykGFg=", 55 + "type": "file", 56 + "url": "https://unpkg.com/lucide@latest" 57 + }, 58 + "original": { 59 + "type": "file", 60 + "url": "https://unpkg.com/lucide@latest" 61 + } 62 + }, 51 63 "nixpkgs": { 52 64 "locked": { 53 65 "lastModified": 1738589849, ··· 68 80 "gitignore": "gitignore", 69 81 "htmx-src": "htmx-src", 70 82 "indigo": "indigo", 83 + "lucide-src": "lucide-src", 71 84 "nixpkgs": "nixpkgs" 72 85 } 73 86 }
+6
flake.nix
··· 11 11 url = "https://unpkg.com/htmx.org@2.0.4/dist/htmx.min.js"; 12 12 flake = false; 13 13 }; 14 + lucide-src = { 15 + url = "https://unpkg.com/lucide@latest"; 16 + flake = false; 17 + }; 14 18 gitignore = { 15 19 url = "github:hercules-ci/gitignore.nix"; 16 20 inputs.nixpkgs.follows = "nixpkgs"; ··· 22 26 nixpkgs, 23 27 indigo, 24 28 htmx-src, 29 + lucide-src, 25 30 gitignore, 26 31 }: let 27 32 supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"]; ··· 51 56 src = gitignoreSource ./.; 52 57 postConfigureHook = '' 53 58 cp -f ${htmx-src} appview/pages/static/htmx.min.js 59 + cp -f ${lucide-src} appview/pages/static/lucide.min.js 54 60 ${pkgs.tailwindcss}/bin/tailwindcss -i input.css -o appview/pages/static/tw.css 55 61 ''; 56 62 subPackages = ["cmd/appview"];
+3
knotserver/routes.go
··· 52 52 l.Error("fetching commits", "error", err.Error()) 53 53 return 54 54 } 55 + if len(commits) > 10 { 56 + commits = commits[:10] 57 + } 55 58 56 59 var readmeContent template.HTML 57 60 for _, readme := range h.c.Repo.Readme {