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 | ad2d44c43b41a25b68ee2aa71cccafb21b0e5f93 (patch) | |
| tree | b50ba3ad29e3149bcab9c1a7bb1d1780edcac35d | |
| parent | cd3364fe07535f73aee1edbcf746e420641cc16c (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
| -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 }} |
