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

single.html « _default « layouts - github.com/g1eny0ung/hugo-theme-dream.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9101604f26cc941a567283a4cb9371c80d554b89 (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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
{{ define "title" }}{{ .Title }}{{ end }}

{{ define "css" }}

{{ if .Site.Params.highlightjs }}
{{ if .Site.Params.highlightjsTheme }}
<link rel="stylesheet" data-highlight href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release/build/styles/{{ .Site.Params.highlightjsTheme }}.min.css" />
{{ else }}
<link rel="stylesheet" data-highlight href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release/build/styles/default.min.css" />
{{ end }}
{{ end }}

{{ if .Site.Params.valine }}
<script src='//unpkg.com/valine/dist/Valine.min.js'></script>
{{ end }}

{{ end }}

{{ define "main" }}
<div class="ui relaxed centered grid dream-grid dream-grid-single"{{ if .Site.Params.reversePostAndAside }}style="flex-direction: row-reverse;"{{ end }}>
  <!-- len <nav id="TableOfContents"></nav> == 32 -->
  {{ $showTOC := ge (len .TableOfContents) 33 }}
  {{ $shareInAside := .Site.Params.shareInAside }}
  {{ $showAside := or $showTOC $shareInAside }}

  {{ if $showAside }}
  <aside class="sixteen wide mobile sixteen wide tablet three wide computer column dream-single-aside">
    {{ if $showTOC }}
    <div class="ui segment toc">
      {{ .TableOfContents }}
    </div>
    {{ end }}

    {{ if $shareInAside }}
    {{ partial "share1.html" . }}
    {{ end }}
  </aside>
  {{ end }}
  <div class="sixteen wide mobile sixteen wide tablet ten wide computer column markdown-body dream-single" id="dream-save-post-as-img">
    <section class="ui top attached segment">
      <header>
        <h1 class="ui large header">
          {{- .Title -}}
          <span class="sub header">
            <span class="left">
              @
              {{ if isset .Params "author" }}
                {{ if isset .Params "authorlink" }}
                  <a href="{{ .Params.authorlink }}" target="_blank">{{ .Params.author }}</a>
                {{ else }}
                  {{ .Params.author }}
                {{ end }}
              {{ else }}
                {{ .Site.Params.author }}
              {{ end }}

              | {{ if .Site.Params.Experimental.jsDate }}
                  <span data-format="luxon">{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}</span>
                {{ else }}
                  {{ if eq .Site.Language.Lang "zh" }}
                    {{ index .Site.Data.zh.Weekday (printf "%d" .Date.Weekday) }},{{ index .Site.Data.zh.Month (printf "%d" .Date.Month) }} {{ .Date.Day }} 日,{{ .Date.Year }} 年
                  {{ else if eq .Site.Language.Lang "es" }}
                    {{ index .Site.Data.es.Weekday (printf "%d" .Date.Weekday) }}, {{ .Date.Day }} de {{ index .Site.Data.es.Month (printf "%d" .Date.Month) }} de {{ .Date.Year }}
                  {{ else if eq .Site.Language.Lang "pt" }}
                    {{ index .Site.Data.pt.Weekday (printf "%d" .Date.Weekday) }}, {{ .Date.Day }} de {{ index .Site.Data.pt.Month (printf "%d" .Date.Month) }} de {{ .Date.Year }}
                  {{ else if eq .Site.Language.Lang "fr" }}
                    {{ index .Site.Data.fr.Weekday (printf "%d" .Date.Weekday) }} {{ .Date.Day }} {{ index .Site.Data.fr.Month (printf "%d" .Date.Month) }} {{ .Date.Year }}
                  {{ else }}
                    {{ .Date.Format "Monday, Jan 2, 2006" }}
                  {{ end }}
                {{ end }}

              | {{ .ReadingTime }}{{ i18n "minuteRead" .ReadingTime }}

              {{ if ne .Params.nolastmod true }}
              | {{ i18n "updateAt" }}
                {{ if .Site.Params.Experimental.jsDate }}
                  <span data-format="luxon">{{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" }}</span>
                {{ else }}
                  {{ if eq .Site.Language.Lang "zh" }}
                    {{ index .Site.Data.zh.Weekday (printf "%d" .Lastmod.Weekday) }},{{ index .Site.Data.zh.Month (printf "%d" .Lastmod.Month) }} {{ .Lastmod.Day }} 日,{{ .Lastmod.Year }} 年
                  {{ else if eq .Site.Language.Lang "es" }}
                    {{ index .Site.Data.es.Weekday (printf "%d" .Lastmod.Weekday) }}, {{ .Lastmod.Day }} de {{ index .Site.Data.es.Month (printf "%d" .Lastmod.Month) }} de {{ .Lastmod.Year }}
                  {{ else if eq .Site.Language.Lang "pt" }}
                    {{ index .Site.Data.pt.Weekday (printf "%d" .Lastmod.Weekday) }}, {{ .Lastmod.Day }} de {{ index .Site.Data.pt.Month (printf "%d" .Lastmod.Month) }} de {{ .Lastmod.Year }}
                  {{ else if eq .Site.Language.Lang "fr" }}
                    {{ index .Site.Data.fr.Weekday (printf "%d" .Date.Weekday) }} {{ .Date.Day }} {{ index .Site.Data.fr.Month (printf "%d" .Date.Month) }} {{ .Date.Year }}
                  {{ else }}
                    {{ .Lastmod.Format "Monday, Jan 2, 2006" }}
                  {{ end }}
                {{ end }}
              {{ end }}
            </span>

            {{ if not $shareInAside }}
            {{ partial "share.html" . }}
            {{ end }}
          </span>
        </h1>
      </header>

      <article class="main">
        {{ if and .Params.Cover .Site.Params.showSummaryCoverInPost }}
        <img class="cover" src="{{ .Params.Cover }}" />
        {{ end }}

        {{ .Content | emojify }}
      </article>
    </section>

    {{ if .Site.DisqusShortname }}
    <article class="ui segment post-disqus-area" data-html2canvas-ignore>
      {{ partial "disqus.html" (dict "Context" . "Identifier" .RelPermalink) }}
    </article>
    {{ end }}

    {{ if .Site.Params.utterancesRepo }}
    <article class="ui segment utterances-comments" data-html2canvas-ignore>
      <script
        src="https://utteranc.es/client.js"
        repo="{{ .Site.Params.utterancesRepo }}"
        issue-term="og:title"
        theme="github-light"
        crossorigin="anonymous"
        async>
      </script>
    </article>
    {{ end }}

    {{ if .Site.Params.valine }}
    <article class="ui segment" data-html2canvas-ignore>
      <div id="vcomments"></div>
    </article>

    <script>
      new Valine({
        el: '#vcomments',
        appId: {{ .Site.Params.LEANCLOUD_APP_ID }},
        appKey: {{ .Site.Params.LEANCLOUD_APP_KEY }}
      })
    </script>
    {{ end }}
  </div>
</div>
{{ end }}

{{ define "js" }}

{{ if .Site.Params.Experimental.jsDate }}
<script src="https://cdn.jsdelivr.net/npm/luxon@1.26.0/build/global/luxon.min.js"></script>

{{ partial "luxon.html" . }}
{{ end }}

<script src="{{ "/js/scrollToTop.js" | relURL }}"></script>

{{ if .Site.Params.highlightjs }}
<script src="{{ if .Site.Params.highlightjsCDN }}{{ .Site.Params.highlightjsCDN }}{{ else }}{{ "https://cdn.jsdelivr.net/gh/highlightjs/cdn-release/build/highlight.min.js" }}{{ end}}"></script>

{{ if .Site.Params.highlightjsExtraLanguages }}
{{ range .Site.Params.highlightjsExtraLanguages }}
<script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release/build/languages/{{ . }}.min.js"></script>
{{ end }}
{{ end }}

{{ partial "highlight.html" . }}
{{ end }}

<script src="https://cdn.jsdelivr.net/npm/html2canvas@1.0.0-rc.1/dist/html2canvas.min.js"></script>
<script src="{{ "/js/post.js" | relURL }}" defer></script>
{{ end }}