forked from tangled.org/core
Monorepo for Tangled — https://tangled.org

add lucide icons

Changed files
+40 -6
appview
pages
templates
knotserver
+4
appview/pages/templates/layouts/base.html
···
{{ end }}
</header>
<main class="content">{{ block "content" . }}{{ end }}</main>
+
<script src="/static/lucide.min.js"></script>
+
<script>
+
lucide.createIcons();
+
</script>
</body>
</html>
{{ end }}
+2 -2
appview/pages/templates/repo/blob.html
···
{{ $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 }}
+12 -4
appview/pages/templates/repo/index.html
···
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 }}
···
{{ 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
+13
flake.lock
···
"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,
···
"gitignore": "gitignore",
"htmx-src": "htmx-src",
"indigo": "indigo",
+
"lucide-src": "lucide-src",
"nixpkgs": "nixpkgs"
}
}
+6
flake.nix
···
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";
···
nixpkgs,
indigo,
htmx-src,
+
lucide-src,
gitignore,
}: let
supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"];
···
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"];
+3
knotserver/routes.go
···
l.Error("fetching commits", "error", err.Error())
return
}
+
if len(commits) > 10 {
+
commits = commits[:10]
+
}
var readmeContent template.HTML
for _, readme := range h.c.Repo.Readme {