Welcome to mirror list, hosted at ThFree Co, Russian Federation.

single.html « _default « layouts - github.com/wangchucheng/hugo-eureka.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8656069b6b6ba3e71fb10b575e8f45289d8393fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{{ define "main" }}
{{ $hasToc := and (in .TableOfContents "<li>" ) (.Params.toc) }}
{{ $hasSidebar := or ($hasToc) (.Params.series) }}
<div class="grid grid-cols-2 lg:grid-cols-8 gap-4 lg:pt-12">
    <div
        class="col-span-2 {{ if not $hasSidebar }} {{- print "lg:col-start-2" -}} {{ end }} lg:col-span-6 bg-secondary-bg rounded px-6 py-8">
        <h1 class="font-bold text-3xl text-primary-text">{{ .Title }}</h1>
        {{ partial "components/post-metadata" . }}
        
        {{ $featured := partial "utils/get-featured" . }}
        {{ with $featured }}
        <div class="my-4">
            {{ . }}
        </div>
        {{ end }}

        <div class="content">
            {{ .Content}}
        </div>
        {{ with .GetTerms "tags" }}
        {{ partial "components/post-tags" . }}
        {{ end }}
        
        {{ if or .Site.Params.repoURL .Site.Params.repoEditURL }}
        {{ partial "components/post-edit" . }}
        {{ end }}
        
        {{ with .GetTerms "authors" }}
        {{ partial "components/post-author" . }}
        {{ end }}
        
        {{ partial "components/post-footer" . }}
        {{ partial "comment.html" . }}
    </div>
    {{ if $hasSidebar}}
    <div class="col-span-2">
        {{ if .GetTerms "series" }}
        {{ partial "components/post-series" . }}
        {{ end }}
        {{ if $hasToc }}
        {{ partial "components/post-toc" . }}
        {{ end }}
    </div>
    {{ end }}

    {{ $related := .Site.RegularPages.Related . | first 6 }}
    {{ with $related }}
    <div
        class="col-span-2 {{ if not $hasSidebar }} {{- print "lg:col-start-2" -}} {{ end }} lg:col-span-6 bg-secondary-bg rounded p-6">
        <h2 class="text-lg font-semibold mb-4">{{ i18n "seeAlso" }}</h2>
        <div class="content">
            {{ range . }}
            <a href="{{ .Permalink }}">{{ .LinkTitle }}</a>
            <br />
            {{ end }}
        </div>
    </div>
    {{ end }}
</div>
<script>
    document.addEventListener('DOMContentLoaded', ()=>{
        hljs.initHighlightingOnLoad();
    })
</script>
{{ end }}