mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
133 lines
6.1 KiB
HTML
133 lines
6.1 KiB
HTML
{{- $params := partial "function/params.html" -}}
|
|
|
|
{{- /* Git info */ -}}
|
|
{{- $gitRepo := "" -}}
|
|
{{- $blobURL := "" -}}
|
|
{{- $sourceURL := "" -}}
|
|
{{- $editURL := "" -}}
|
|
{{- $reportURL := "" -}}
|
|
{{- with .Site.Params.gitInfo -}}
|
|
{{- if .Repo -}}
|
|
{{- $gitRepo = strings.TrimSuffix "/" .Repo -}}
|
|
{{- $blobURL = printf "%v/blob/%v/%v/{path}" $gitRepo .Branch .Dir -}}
|
|
{{- $editURL = printf "%v/edit/%v/%v/{path}" $gitRepo .Branch .Dir -}}
|
|
{{- $reportURL = printf "%v/issues/new?%v" $gitRepo .IssueTpl -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
|
|
<div class="post-footer" id="post-footer">
|
|
<div class="post-info">
|
|
<div class="post-info-line">
|
|
<div class="post-info-mod">
|
|
<span title="{{ dict "Date" ("2006-01-02 15:04:05" | .Lastmod.Format) | T "single.updatedOnDate" }}">
|
|
{{- with .Lastmod | dateFormat (.Site.Params.dateformat | default "2006-01-02") -}}
|
|
{{- dict "Date" . | T "single.updatedOnDate" -}}
|
|
{{- if $gitRepo -}}
|
|
{{- with $.GitInfo -}}
|
|
{{/* TODO add Git .Body */}}
|
|
<a class="git-hash" href="{{ printf `%v/commit/%v` $gitRepo .Hash }}" rel="external nofollow noopener noreferrer" target="_blank" title="commit by {{ .AuthorName }}({{ .AuthorEmail }}) {{ .Hash }}: {{ .Subject }}">
|
|
{{- dict "Class" "fa-solid fa-hashtag fa-fw" | partial "plugin/icon.html" -}}
|
|
{{- .AbbreviatedHash -}}
|
|
</a>
|
|
{{- end -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
</span>
|
|
</div>
|
|
{{- if not $params.password -}}
|
|
{{- with $params.license | string -}}
|
|
<div class="post-info-license">
|
|
<span>{{ . | safeHTML }}</span>
|
|
</div>
|
|
{{- end -}}
|
|
{{- end -}}
|
|
</div>
|
|
{{- if not $params.password -}}
|
|
<div class="post-info-line">
|
|
<div class="post-info-md">
|
|
{{- $linkOptions := slice -}}
|
|
{{- if $params.LinkToMarkdown -}}
|
|
{{- with .OutputFormats.Get "markdown" -}}
|
|
{{- $options := dict "Class" "link-to-markdown" "Destination" .RelPermalink "Title" (T "single.readMarkdown") "Content" (T "single.readMarkdown") "externalIcon" false -}}
|
|
{{- $linkOptions = $linkOptions | append $options -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
{{- if $params.LinkToSource | and $gitRepo -}}
|
|
{{- $link := replace $blobURL "{path}" $.File.Path -}}
|
|
{{- $sourceURL = $params.sourceURL | default (add $link "?plain=1") -}}
|
|
{{- $options := dict "Class" "link-to-source" "Destination" $sourceURL "Title" (T "single.viewSource") "Content" (T "single.viewSource") "externalIcon" false -}}
|
|
{{- $linkOptions = $linkOptions | append $options -}}
|
|
{{- end -}}
|
|
{{- if $params.LinkToEdit | and $gitRepo -}}
|
|
{{- $link := replace $editURL "{path}" $.File.Path -}}
|
|
{{- $editURL = $params.editURL | default $link -}}
|
|
{{- $options := dict "Class" "link-to-edit" "Destination" $editURL "Title" (T "single.editThisPage") "Content" (T "single.editThisPage") "externalIcon" false -}}
|
|
{{- $linkOptions = $linkOptions | append $options -}}
|
|
{{- end -}}
|
|
{{- if $params.LinkToReport | and $gitRepo -}}
|
|
{{- $link := replace $reportURL "{title}" ($.Title | urlquery) -}}
|
|
{{- $link = replace $link "{URL}" $.Permalink -}}
|
|
{{- $link = replace $link "{sourceURL}" $sourceURL -}}
|
|
{{- $options := dict "Class" "link-to-report" "Destination" $link "Title" (T "single.reportIssue") "Content" (T "single.reportIssue") "externalIcon" false -}}
|
|
{{- $linkOptions = $linkOptions | append $options -}}
|
|
{{- end -}}
|
|
{{- range $linkOptions -}}
|
|
<span>{{ partial "plugin/link.html" . }}</span>
|
|
{{- end -}}
|
|
</div>
|
|
<div class="post-info-share">
|
|
<span>
|
|
{{- partial "plugin/share.html" . -}}
|
|
</span>
|
|
</div>
|
|
</div>
|
|
{{- end -}}
|
|
</div>
|
|
|
|
<div class="post-info-more">
|
|
<section class="post-tags">
|
|
{{- $tagTerms := .GetTerms "tags" -}}
|
|
{{- if $tagTerms -}}
|
|
{{- dict "Class" "fa-solid fa-tags fa-fw me-1" | partial "plugin/icon.html" -}}
|
|
{{- range $tagTerms -}}
|
|
<a href="{{ partial "function/escapeurl.html" .RelPermalink }}" class="post-tag" title="{{ printf "%v - %v" (T "tags") .LinkTitle }}">{{ .LinkTitle }}</a>
|
|
{{- end -}}
|
|
{{- end -}}
|
|
</section>
|
|
<section>
|
|
<span><a href="javascript:void(0);" onclick="window.history.back();">{{ T "single.back" }}</a></span> | <span><a href="{{ .Scratch.Get "homeRelPermalink" }}">{{ T "single.home" }}</a></span>
|
|
</section>
|
|
</div>
|
|
|
|
{{- $navigation := .Site.Params.navigation -}}
|
|
<div class="post-nav">
|
|
{{- $pages := .Scratch.Get "mainSectionPages" -}}
|
|
{{- $prev := $pages.Prev . -}}
|
|
{{- $next := $pages.Next . -}}
|
|
{{- /* Show the post navigation in section pages */ -}}
|
|
{{- if $navigation.inSection -}}
|
|
{{- $prev = .PrevInSection -}}
|
|
{{- $next = .NextInSection -}}
|
|
{{- end -}}
|
|
{{- /* Reverse the next/previous post navigation order */ -}}
|
|
{{- if $navigation.reverse -}}
|
|
{{- $prev = $pages.Next . -}}
|
|
{{- $next = $pages.Prev . -}}
|
|
{{- end -}}
|
|
{{- with $prev -}}
|
|
{{- $capitalizeTitles := .Param "capitalizeTitles" -}}
|
|
<a href="{{ .RelPermalink }}" class="post-nav-item" rel="prev" title="{{ cond $capitalizeTitles (title .LinkTitle) .LinkTitle }}">
|
|
{{- dict "Class" "fa-solid fa-angle-left fa-fw" | partial "plugin/icon.html" -}}
|
|
{{- cond $capitalizeTitles (title .LinkTitle) .LinkTitle -}}
|
|
</a>
|
|
{{- end -}}
|
|
{{ with $next }}
|
|
{{- $capitalizeTitles := .Param "capitalizeTitles" -}}
|
|
<a href="{{ .RelPermalink }}" class="post-nav-item" rel="next" title="{{ cond $capitalizeTitles (title .LinkTitle) .LinkTitle }}">
|
|
{{- cond $capitalizeTitles (title .LinkTitle) .LinkTitle -}}
|
|
{{- dict "Class" "fa-solid fa-angle-right fa-fw" | partial "plugin/icon.html" -}}
|
|
</a>
|
|
{{- end -}}
|
|
</div>
|
|
</div>
|