Monorepo for Tangled tangled.org

add lucide icons

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