www-from-model/layouts/publications/term.html
Michael Hanke cef468caf3
All checks were successful
Deploy on webserver / Build site and deploy on success (push) Successful in 42s
fix: left-align graph node type controls
The copies are bad. This should be a single partial.
2026-05-21 19:43:15 +02:00

99 lines
3.7 KiB
HTML

{{ define "main" }}
<header>
{{ if .Params.showBreadcrumbs | default (.Site.Params.list.showBreadcrumbs | default false) }}
{{ partial "breadcrumbs.html" . }}
{{ end }}
<h1 class="mt-0 mb-2 text-4xl font-extrabold text-neutral-900 dark:text-neutral">{{ .Title }}
{{ if .Params.date }}
{{ $year := substr .Params.date 0 4 }}
<span class="text-2xl">
({{ $year }})
</span>
{{ end }}
{{ with .Params.doi }}
<span class="mt-3 text-xl" style="border-left: 1px solid grey; padding-left: 0.5em; margin-left: 0.5em;">
<a
href="https://doi.org/{{ . }}"
target="_blank"
class="text-primary-600"
style="text-decoration: unset;"
>
DOI: {{ . }}
</a>
</span>
{{ end }}
{{ with .Params.kind }}
<span class="mt-3 text-xl" style="font-style: italic; border-left: 1px solid grey; padding-left: 0.5em; margin-left: 0.5em;">
{{ . | replaceRE "^.*:" "" }}
</span>
{{ end }}
</h1>
</header>
<article class="prose max-w-full dark:prose-invert">
<!-- Authors -->
{{ with .GetTerms "persons" }}
<div class="mb-2 flex flex-wrap gap-2">
<span class="ms-1 border-primary-400 px-1 py-[1px] text-xs font-normal text-primary-700 dark:border-primary-600 dark:text-primary-400">
<em>Authors:</em>
</span>
{{ range . }}
<span class="ms-1 rounded-md border border-primary-400 px-1 py-[1px] text-xs font-normal text-primary-700 dark:border-primary-600 dark:text-primary-400">
<a style="text-decoration: none;" href="{{ .Permalink }}">{{ .Title }}</a>
</span>
{{ end }}
</div>
{{ end }}
<!-- Topics -->
{{ with .GetTerms "topics" }}
<div class="mb-2 flex flex-wrap gap-2">
<span class="ms-1 border-primary-400 px-1 py-[1px] text-xs font-normal text-primary-700 dark:border-primary-600 dark:text-primary-400">
<em>Topics:</em>
</span>
{{ range . }}
<span class="ms-1 rounded-md border border-secondary-400 px-1 py-[1px] text-xs font-normal text-secondary-700 dark:border-secondary-600 dark:text-secondary-400">
<a style="text-decoration: none;" href="{{ .Permalink }}">{{ .Title }}</a>
</span>
{{ end }}
</div>
{{ end }}
<!-- Depiction and Graph -->
{{ $depictions := .Resources.Match "depiction.*" }}
{{ $hasDepiction := gt (len $depictions) 0 }}
<table class="not-prose w-full">
<tr>
{{ if $hasDepiction }}
<td width="40%" class="align-middle text-center">
{{ with index $depictions 0 }}
<img src="{{ .RelPermalink }}" alt="depiction of publication">
{{ end }}
</td>
{{ end }}
<td class="align-middle text-center">
{{ if .Param "graphRootNodePID" | default false }}
<div class="prose max-w-full dark:prose-invert">
<script>
const limitGraphRootNodeId = '{{ .Param "graphRootNodePID" }}';
</script>
<script type="module" crossorigin src="/graph.js"></script>
<div class="relative">
{{ if .Param "graphDescription" | default false }}
<p>{{ .Param "graphDescription" }}</p>
{{ end }}
<div id="sigma-node-type-controls" class="absolute z-10 left-2 bottom-2" >
<div id="sigma-controls-list" class="text-left" ></div>
</div>
<div id="sigma-container" class="w-full h-[40vh] m-0 p-0 bg-neutral-100 dark:bg-neutral-600" ></div>
</div>
</div>
{{ end }}
</td>
</tr>
</table>
<!-- Abstract -->
{{ with .Params.description }}
<p>{{ . }}</p>
{{ end }}
</article>
{{ end }}