Mirror of @tangled.org/core. Running on a Raspberry Pi Zero 2 (Please be gentle).

add lucide icons

+27 -6
+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 }} ··· 24 20 {{ range .Files }} 25 21 {{ if .IsFile }} 26 22 <div class="{{ $containerstyle }}"> 27 - <a href="/{{ $.RepoInfo.FullName }}/blob/{{ $.Ref }}/{{ .Name }}" class="{{ $linkstyle }}">{{ .Name }}</a> 23 + <a href="/{{ $.RepoInfo.FullName }}/blob/{{ $.Ref }}/{{ .Name }}" class="{{ $linkstyle }}"> 24 + <div class="flex items-center gap-2"> 25 + <i class="w-3 h-3" data-lucide="file"></i>{{ .Name }} 26 + </div> 27 + </a> 28 28 </div> 29 29 {{ end }} 30 30 {{ end }} 31 31 </div> 32 - <div id="file-tree" class="flex-1"> 32 + <div id="commit-log" class="flex-1"> 33 33 {{ range .Commits }} 34 34 <div class= 35 35 "relative
flake.lock

This is a binary file and will not be displayed.

+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"; ··· 26 22 nixpkgs, 27 23 indigo, 28 24 htmx-src, 25 + lucide-src, 29 26 gitignore, 30 27 }: let 31 28 supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"]; ··· 56 51 src = gitignoreSource ./.; 57 52 postConfigureHook = '' 58 53 cp -f ${htmx-src} appview/pages/static/htmx.min.js 54 + cp -f ${lucide-src} appview/pages/static/lucide.min.js 59 55 ${pkgs.tailwindcss}/bin/tailwindcss -i input.css -o appview/pages/static/tw.css 60 56 ''; 61 57 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 {