hugo-ui-blog/layouts/articles/single.html

10 KiB

{{ define "main" }} {{ $cfg := (site.Params.node) }} {{ $tabsID := ((printf "node-tabs-%s" (.File.UniqueID)) | md5) }} {{ $changelog := (path.Join (.File.Dir) "changelog.md") }} {{ (partial "breadcrumb" .) }}
{{ if ($cfg.cover.enabled) }}
{{ (partial "module/node/cover/02" .) }}
{{ end }}

{{ (.Title) }}

    {{ with (.Params.date) }}
  • {{ end }} {{ with (.Params.complexity) }}
  • {{ with (eq . "0") }}
  • {{ end }} {{ with (eq . "1") }}
  • {{ end }} {{ with (eq . "2") }}
  • {{ end }} {{ end }}
  • {{ if ($cfg.tabs.source.enabled) }}
  • {{ end }} {{ if (and ($cfg.tabs.changelog.enabled) (fileExists ($changelog))) }}
  • {{ end }} {{ if ($cfg.tabs.info.enabled) }}
  • {{ end }} {{ if ($cfg.tabs.comments.enabled) }} {{ with (.Params.comments) }}
  • {{ end }} {{ end }} {{ if (.IsTranslated) }}
  • {{ end }} {{ if ($cfg.tabs.share.enabled) }}
  • {{ end }}
{{ if (in (.Params.categories) "inDev") }} {{ (partial "function/alert" (dict "type" "warning" "icon" "fas fa-edit" "msg" (i18n "alert.in_dev") )) }} {{ end }} {{ if (in (.Params.categories) "inHistory") }} {{ (partial "function/alert" (dict "type" "warning" "icon" "fas fa-clock-rotate-left" "msg" (i18n "alert.in_history") )) }} {{ end }} {{ if (in (.Params.categories) "opinion") }} {{ (partial "function/alert" (dict "type" "warning" "icon" "fas fa-user-graduate" "msg" (i18n "alert.opinion") )) }} {{ end }} {{ (partial "module/node/toc" .) }} {{ (.Content) }} {{ (partial "module/node/sources" .) }}
{{ if ($cfg.tabs.source.enabled) }}
{{ (highlight (readFile (.File.Path)) "md") }}
{{ end }} {{ if (and ($cfg.tabs.changelog.enabled) (fileExists ($changelog))) }}
{{ ((readFile ($changelog)) | markdownify) }}
{{ end }} {{ if ($cfg.tabs.info.enabled) }}
{{ if ($cfg.tabs.info.categories.enabled) }}
{{ (partial "module/node/tabs/info/categories" .) }}
{{ end }} {{ if ($cfg.tabs.info.tags.enabled) }}
{{ (partial "module/node/tabs/info/tags" .) }}
{{ end }} {{ if ($cfg.tabs.info.authors.enabled) }}
{{ (partial "module/node/tabs/info/authors" .) }}
{{ end }} {{ if ($cfg.tabs.info.related.enabled) }}
{{ (partial "module/node/tabs/info/related" .) }}
{{ end }} {{ if ($cfg.tabs.info.meta.enabled) }}
{{ (partial "module/node/tabs/info/meta" .) }}
{{ end }} {{ if ($cfg.tabs.info.stats.enabled) }}
{{ (partial "module/node/tabs/info/stats" .) }}
{{ end }}
{{ end }} {{ if ($cfg.tabs.comments.enabled) }} {{ with (.Params.comments) }}
{{ (partial "module/node/tabs/comments" .) }}
{{ end }} {{ end }} {{ if (.IsTranslated) }}
{{ (partial "module/node/tabs/languages" .) }}
{{ end }} {{ if ($cfg.tabs.share) }}
{{ (partial "module/node/tabs/share" .) }}
{{ end }}
{{ end }}