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

single.html « _default « layouts - github.com/AmazingRise/hugo-theme-diary.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f1e2a0c65a6d069c2a44f031fc29d302e2449573 (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
{{ define "main" }}

    <div class="post-list-container post-list-container-shadow">
        <div class="post">
            {{ $post_class := "post-head-wrapper-text-only"}}
            {{ $featured_image := .Params.featured_image }}
            {{ if $featured_image }}
                {{ $post_class = "post-head-wrapper"}}
            {{ end }}

            <div class="{{$post_class}}"
                {{ if $featured_image }}
                    {{ $image := .Resources.GetMatch (.Params.featured_image) }}
                    {{ if $image }}
                    style="background-image: url('{{$image.Permalink }}')"
                    {{ else }}
                    style="background-image: url('{{ $featured_image | absURL}}')"
                    {{ end }}
                {{ end }}
            >
                <div class="post-title">
                    {{ .Title }}
                    {{ if .Params.description }}
                    <div class="post-subtitle">
                        {{ .Params.description }}
                    </div>
                    {{ end }}
                    <div class="post-meta">
                        {{ if .Params.date}}
                        <time itemprop="datePublished">
                            {{ i18n "format_date_tosec" .PublishDate }}
                        </time>
                        {{ end }}

                        {{ if .Params.categories }}
                            <i class="material-icons" style="">folder</i>
                                <a href="{{ "/categories/" | relLangURL }}{{ .Params.categories | urlize }}">{{ .Params.categories }}</a>
                                &nbsp;
                        {{ end }}

                        {{ if gt .Params.tags 0 }}
                            <i class="material-icons" style="">label</i>
                            {{ range .Params.tags }}
                                <a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a>
                                &nbsp;
                            {{ end }}
                        {{ end }}
                        {{ if .Site.Params.enableReadingTime }}
                            <i class="material-icons" style="">schedule</i>
                            {{ $readTime := mul (div (countwords .Content) 220.0) 60 }}

                            {{ $minutes := math.Floor (div $readTime 60) }}
                            {{ $seconds := mod $readTime 60 }}

                            {{ if gt $minutes 0}}
                            {{ $minutes }} {{ cond (eq $minutes 1) "minute" "min" }}
                            {{ end }}
                            {{ $seconds }} {{ cond (eq $seconds 1) "second" "s" }}.
                        {{ end }}
                    </div>
                </div>
            </div>
            
            <div class="post-body-wrapper">
                {{ if .Params.enableVue }}
                <div class="post-body">
                {{ else }}
                <div class="post-body" v-pre>
                {{ end }}
                    {{.Content}}
                    {{ if not .Lastmod.IsZero }}
                    <HR width="100%" id="EOF">
		    <p style="color:#777;">{{ i18n "last_mod_on" .Page.Lastmod }}</p>
                    {{ end }}
                </div>
            </div>
            
            
            <nav class="post-pagination">

                {{if .Next}}
                <a class="newer-posts" href="{{.Next.Permalink}}">
			{{ i18n "next_link" }}<br>{{.Next.Title}}
                </a>
                {{else}}
                <a class="newer-posts">
			{{ i18n "next_link" }}<br>{{ i18n "no_newer_posts"}}
                </a>
                {{end}}
                
                {{if .Prev}}
                <a class="older-posts" href="{{.Prev.Permalink}}">
			{{ i18n "prev_link" }}<br>{{.Prev.Title}}
                </a>
                {{else}}
                <a class="older-posts">
			{{ i18n "prev_link" }}<br>{{ i18n "no_older_posts" }}
                </a>
                {{end}}
            </nav>
            <div class="post-comment-wrapper">
                {{ if eq .Params.comment false }}
                <p style="opacity: 0.6" align="center">
                    <small>{{ i18n "comments_disabled" }}</small>
                </p>
                {{ else }}
                {{- partial "comment.html" . -}}
                {{ end }}
            </div>
        </div>
    </div>

{{ end }}