diff options
author | mms <git@sapka.me> | 2024-11-23 23:43:53 +0100 |
---|---|---|
committer | mms <git@sapka.me> | 2024-11-23 23:43:53 +0100 |
commit | 65ee10d360ceab1768b6650123976bdc9585f56e (patch) | |
tree | b87ccfd7795ff5ff9859a8e1452f1a7dd406b6c2 /layouts/shortcodes/links.html | |
parent | 1711cc312f7e65e2fb9dc633f8d5dc06f67ddf0c (diff) |
feat: sort
Diffstat (limited to 'layouts/shortcodes/links.html')
-rw-r--r-- | layouts/shortcodes/links.html | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/layouts/shortcodes/links.html b/layouts/shortcodes/links.html index 5acde5d..6d40dae 100644 --- a/layouts/shortcodes/links.html +++ b/layouts/shortcodes/links.html @@ -4,9 +4,14 @@ {{ with . | transform.Unmarshal }} <table class="links"> - {{ range (sort .links "Title") }} + {{ range (sort .links "Title" "asc") }} {{ $letter := slicestr .Title 0 1 }} + {{ $letter = strings.ToUpper $letter }} + {{ if findRE `\d` $letter }} + {{ $letter = "0-9" }} + {{ end}} {{ if not (eq $letter $lastLetter) }} + <tr> <td colspan="2"> <hr> |