diff options
| author | eltrac <hi@eltr.ac> | 2026-04-07 14:53:17 +0800 |
|---|---|---|
| committer | eltrac <hi@eltr.ac> | 2026-04-07 14:53:17 +0800 |
| commit | 10431bd8f5ff71690ae4e5444e8d7894fd401ae5 (patch) | |
| tree | 62b7fd1b6c1f68d2804f380eb522bcebeb2c8d9f /layouts/_partials/components/backlinks.html | |
| parent | 3e0edacc4a0cafa53ede57ebb6f0378c93f3123b (diff) | |
chore: move templates out of site repo
Diffstat (limited to 'layouts/_partials/components/backlinks.html')
| -rw-r--r-- | layouts/_partials/components/backlinks.html | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/layouts/_partials/components/backlinks.html b/layouts/_partials/components/backlinks.html deleted file mode 100644 index e97c295c..00000000 --- a/layouts/_partials/components/backlinks.html +++ /dev/null @@ -1,37 +0,0 @@ -{{ $type := .type }} -{{ $filename := .filename }} -{{ $ctx := .context }} -{{ $referencedBy := slice }} - -{{ if eq $type "library" }} - {{ range $ctx.Site.Pages }} - {{ if and (isset .Params "mentioned_books") (in .Params.mentioned_books $filename) }} - {{ $referencedBy = $referencedBy | append . }} - {{ end }} - {{ end }} -{{ else if eq $type "cards" }} - {{ range $ctx.Site.Pages }} - {{ if and (isset .Params "related_cards") (in .Params.related_cards $filename) }} - {{ $referencedBy = $referencedBy | append . }} - {{ end }} - {{ end }} -{{ end }} - -{{- /* 如果有文章引用这个卡片,就显示它们 */ -}} -{{ if gt (len $referencedBy) 0 }} -<section class="related-posts post-content my-5"> - <h2 class="text-size-base m-0 flex items-center gap-2"> - <span>反向链接</span> - <span class="inline-block bg-blockBg rounded-full px-1 text-secondary cursor-help text-size-sm" - data-tooltip="这里列出了引用了该页面的其他文章">?</span> - </h2> - <ul class="my-4 list-none ps-4"> - {{- range $referencedBy }} - <li class="flex gap-4"> - <span class="text-secondary">→</span> - <a href="{{ .Permalink }}">{{ .Title }}</a> - </li> - {{- end }} - </ul> -</section> -{{ end }} |
