fabinfra-theme/layouts/partials/header-project.html
2020-03-06 17:20:22 +01:00

30 lines
1.0 KiB
HTML

<div class="item-header">
{{ $.Scratch.Set "link" .RelPermalink }}
{{ with .Params.repo }}
{{ $repoHost := default "gitlab" $.Params.repoHost }}
{{ if eq "github" $repoHost }}
{{ printf "https://github.com/%s/%s/" $.Site.Params.githubUsername . | $.Scratch.Set "link" }}
{{ else if eq "gitlab" $repoHost }}
{{ printf "https://gitlab.com/%s/%s/" $.Site.Params.gitlabUsername . | $.Scratch.Set "link" }}
{{ end }}
{{ end }}
{{ with .Params.link }} {{ $.Scratch.Set "link" . }} {{ end }}
{{ with .Description }} {{ $.Scratch.Set "subtitle" . }} {{ end }}
<h4><a href="{{ .Scratch.Get "link" }}">{{ .Title }}</a></h4>
<h5>{{ $.Scratch.Get "subtitle" }}</h5>
{{ range.Params.categories }}
<a href="{{"/categories/"|relLangURL }}{{.|urlize}}">
<kbd class="item-cat"> {{ . }} </kbd>
</a>
{{ end }}
{{ range .Params.tags }}
<a href="{{"/tags/"|relLangURL }}{{.|urlize}}">
<kbd class="item-tag"> {{ . }} </kbd>
</a>
{{ end }}
</div>