diff options
| author | BigCoke233 <hi@guhub.cn> | 2026-01-13 20:30:25 +0800 |
|---|---|---|
| committer | BigCoke233 <hi@guhub.cn> | 2026-01-13 20:30:25 +0800 |
| commit | a5c7103d0a6a08b48c4d67a6e5c56a4c3dee5df3 (patch) | |
| tree | 2438272fd80be7d9119be593e3306c0816751001 | |
| parent | 7649778bfbde25ef531f8f13005b7bcdf456b117 (diff) | |
fix: opml links not supposed to show "Zone 1" category
also fixed the issue where some of the urls returns feed url instead of
homepage
Former-commit-id: ad2d44c43b41a25b68ee2aa71cccafb21b0e5f93
| -rw-r--r-- | layouts/_shortcodes/opml-links.html | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/layouts/_shortcodes/opml-links.html b/layouts/_shortcodes/opml-links.html index 6928a906..ffa420ad 100644 --- a/layouts/_shortcodes/opml-links.html +++ b/layouts/_shortcodes/opml-links.html @@ -1,13 +1,18 @@ {{ $opml := .Site.Data.rss }} {{ range $zone := $opml.body.outline }} + {{ $title := index $zone "-title" }} + {{ if ne $title "Zone 1 - 家" }} <h2 class="text-xl font-semibold mb-4" style="color: var(--text-color);"> - {{ index $zone "-title" }} + {{ $title }} </h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-8"> {{ range shuffle $zone.outline }} - <a href="{{ index . "-htmlUrl" }}" target="_blank" + {{ $url := index . "-htmlUrl" }} + {{ $parts := split $url "/" }} + {{ $url := printf "%s//%s/" (index $parts 0) (index $parts 2) }} + <a href="{{ $url }}" target="_blank" class="block rounded-md overflow-hidden box-border p-4" style="background-color: var(--block-background-color); color: var(--text-color); @@ -16,4 +21,5 @@ </a> {{ end }} </div> + {{ end }} {{ end }} |
