mirror of
https://github.com/Brandon-Rozek/website-theme.git
synced 2025-12-04 14:50:24 +00:00
Added support for entity linking in tags
This commit is contained in:
parent
56de4bacdb
commit
ded609da7d
1 changed files with 26 additions and 3 deletions
|
|
@ -2,9 +2,32 @@
|
||||||
{{ partial "header.html" . }}
|
{{ partial "header.html" . }}
|
||||||
<main>
|
<main>
|
||||||
<div class='bloglist-teaser block-center' style="margin-top: 2rem;">
|
<div class='bloglist-teaser block-center' style="margin-top: 2rem;">
|
||||||
Here you'll find <strong>{{ len .Pages | lang.FormatNumber 0 }} posts</strong>
|
<p>Here you'll find <strong>{{ len .Pages | lang.FormatNumber 0 }} post{{if gt (len .Pages) 1}}s{{end}}</strong>
|
||||||
about <u>{{ .Title }}</u> </strong>.
|
about <u>{{ .Title }}</u>.</p>
|
||||||
|
|
||||||
|
<!-- Wikidata context -->
|
||||||
|
{{ $tagKey := .Title | urlize }}
|
||||||
|
{{ with index .Site.Data.wikidata_mappings $tagKey }}
|
||||||
|
<div class='wikidata-context block-center' style="margin-top: 1rem; margin-bottom: 2rem;">
|
||||||
|
{{ if eq (len .entities) 1 }}
|
||||||
|
{{ $entity := index .entities 0 }}
|
||||||
|
<p style="font-size: 1.25rem;">
|
||||||
|
Same as <a href="{{ $entity.url }}">{{ $entity.id }}</a>, {{ $entity.description }}.
|
||||||
|
</p>
|
||||||
|
{{ else }}
|
||||||
|
<p style="font-size: 1.25rem;"><strong>These posts may refer to:</strong></p>
|
||||||
|
<ul style="font-size: 1.25rem;">
|
||||||
|
{{ range .entities }}
|
||||||
|
<li>
|
||||||
|
<a href="{{ .url }}">{{ .id }}</a> – {{ .description }}
|
||||||
|
</li>
|
||||||
|
{{ end }}
|
||||||
|
</ul>
|
||||||
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- contents -->
|
<!-- contents -->
|
||||||
<div class="bloglist">
|
<div class="bloglist">
|
||||||
{{ $listPageDateFormat := .Site.Params.listPageDateFormat | default "2006"}}
|
{{ $listPageDateFormat := .Site.Params.listPageDateFormat | default "2006"}}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue