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

single.html « _default « layouts - github.com/uPagge/uBlogger.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4eebf85eb5ac3ed3a592c65614bfa8d54895acf8 (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
{{- define "title" }}{{ .Title }} | {{ .Site.Title }}{{ end -}}

{{- define "content" -}}
    <div class="page single">
        <h1 class="post-title animated pulse faster">
            {{- .Title -}}
        </h1>
        <div class="post-content">
            {{- $content := .Content -}}

            {{- $REin := `:\(([\w- ]+?)\):` -}}
            {{- $REout := `<i class="$1 fa-fw"></i>` -}}
            {{- $content = replaceRE $REin $REout $content -}}

            {{- $REin = `\[(.+?)\]\^\((.+?)\)` -}}
            {{- $REout = `<strong><ruby>$1<rt>$2</rt></ruby></strong>` -}}
            {{- $content = replaceRE $REin $REout $content -}}

            {{- $REin = `<sup>\[return\]</sup>` -}}
            {{- $REout = `↩︎` -}}
            {{- $content = replaceRE $REin $REout $content -}}

            {{- $REin = `<(h[23456]) (id=".+?")>` -}}
            {{- $REout = `<a class="post-dummy-target" $2></a><$1>` -}}
            {{- $content = replaceRE $REin $REout $content -}}

            {{- $REin = `<(.+) (id="fnref:.+?")>` -}}
            {{- $REout = `<a class="post-dummy-target" $2></a><$1>` -}}
            {{- $content = replaceRE $REin $REout $content -}}

            {{- $REin = `<li (id="fn:.+?")(.*?)>\s?<p>` -}}
            {{- $REout = `<li $2><p><a class="post-dummy-target" $1></a>` -}}
            {{- $content = replaceRE $REin $REout $content -}}

            {{- $content | safeHTML -}}
        </div>
    </div>
{{- end -}}