diff --git a/appview/pages/templates/repo/index.html b/appview/pages/templates/repo/index.html index c4988b28..d60707dc 100644 --- a/appview/pages/templates/repo/index.html +++ b/appview/pages/templates/repo/index.html @@ -151,7 +151,7 @@ {{ if .IsFile }} {{ $link = printf "/%s/%s/%s/%s" $.RepoInfo.FullName "blob" (urlquery $.Ref) .Name }} - {{ $icon = "file" }} + {{ $icon = cond .IsSymlink "file-symlink" "file" }} {{ $iconStyle = "size-4" }} {{ end }} diff --git a/appview/pages/templates/repo/tree.html b/appview/pages/templates/repo/tree.html index 96f22f22..fe6604ce 100644 --- a/appview/pages/templates/repo/tree.html +++ b/appview/pages/templates/repo/tree.html @@ -77,7 +77,7 @@ {{ if .IsFile }} {{ $link = printf "/%s/%s/%s/%s/%s" $.RepoInfo.FullName "blob" (urlquery $.Ref) $.Path .Name }} - {{ $icon = "file" }} + {{ $icon = cond .IsSymlink "file-symlink" "file" }} {{ $iconStyle = "size-4" }} {{ end }} diff --git a/types/tree.go b/types/tree.go index 830a9a28..17161705 100644 --- a/types/tree.go +++ b/types/tree.go @@ -101,6 +101,16 @@ func (t *NiceTree) IsSubmodule() bool { return m == filemode.Submodule } +func (t *NiceTree) IsSymlink() bool { + m, err := t.FileMode() + + if err != nil { + return false + } + + return m == filemode.Symlink +} + type LastCommitInfo struct { Hash plumbing.Hash Message string