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

posts-by-views.html « post « layouts - github.com/uPagge/uBlogger.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ee3ab93d0fdd9bb68f074d8110d0473eb4e3f17d (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
{{- define "content" -}}
{{- $params := .Scratch.Get "params" -}}
{{- $profile := .Site.Params.home.profile -}}
{{- $posts := .Site.Params.home.posts -}}

<article class="page home"{{ if ne $posts.enable false }} data-home="posts"{{ end }}>
    {{- /* Profile */ -}}
    {{- if ne $profile.enable false -}}
    {{- partial "home/profile.html" . -}}
    {{- end -}}

    {{- /* Content */ -}}
    {{- if .Content -}}
    <div class="single">
        <div class="content" id="content">
            {{- dict "Content" .Content "Ruby" $params.ruby "Fraction" $params.fraction | partial "function/content.html" | safeHTML -}}
        </div>
    </div>
    {{- end -}}

    {{- /* Posts */ -}}
    {{- if ne $posts.enable false | and .Site.RegularPages -}}
    {{- /* Paginate */ -}}
    {{- $pages :=  where (where site.RegularPages "Type" "in" site.Params.mainSections) "Params.views" "ne" nil -}}

    {{- with $posts.paginate | default .Site.Params.paginate -}}
    {{- $pages = $.Paginate ($pages.ByParam "views").Reverse . -}}
    {{- else -}}
    {{- $pages = .Paginate ($pages.ByParam "views").Reverse -}}
    {{- end -}}

    {{- range $pages.Pages -}}
    {{- .Render "summary" -}}
    {{- end -}}
    {{- partial "paginator.html" . -}}
    {{- end -}}
</article>

{{- $comment := .Site.Params.Comment -}}
{{- $remark42 := $comment.remark42 | default dict -}}
{{- if $remark42.enable -}}
<script>
    var remark_config = {
        host: '{{ $remark42.host }}',
        site_id: '{{ $remark42.site }}',
        components: ['counter']
    };

    (function(c) {
        for(var i = 0; i < c.length; i++){
            var d = document, s = d.createElement('script');
            s.src = remark_config.host + '/web/' +c[i] +'.js';
            s.defer = true;
            (d.head || d.body).appendChild(s);
        }
    })(remark_config.components || ['embed']);
</script>
{{- end -}}
{{- end -}}