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

projects.html « partials « layouts - github.com/vickylaixy/hugo-theme-introduction.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4688f83515f56b00f007944b93c148a3f3e6e3cd (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
<div class="container">
    <!-- Begin Projects container -->
    <h2 class="title is-2 has-text-centered">Projects</h2>

    <div class="section is-small">
        <div class="columns is-multiline">
            {{ $totalProjects := (len (.Site.GetPage "section" "projects").Pages) }}
            {{ $numberOfProjectsToShow := .Site.Params.numberOfProjectsToShow | default $totalProjects }}
            {{ range (.Site.GetPage "section" "projects").Pages | first $numberOfProjectsToShow }}
            {{ if eq (mod $numberOfProjectsToShow 2) 0 }}
            <div class="column is-half">
                {{ else }}
                <div class="column is-one-third">
                    {{ end }}
                    <div {{ if not .Params.external_link }} id="project{{ $card := .Title | urlize }}{{ replace $card "%" " "}}" {{ end }}
                        class="card">
                        <div class="card-image">
                            <figure class="image is-3by2">
                                <a {{ if .Params.external_link }} href="{{ .Params.external_link }}" {{ end }}>
                                    <img src="{{ if .Params.image }}{{ .Params.image | relURL }}{{ else }}{{ (.Site.Params.placeHolderimg | default "/img/workday.jpg") | relURL }}{{ end }}">
                                </a>
                            </figure>
                        </div>
                        <div class="card-content has-text-centered top-pad">
                            <a {{ if .Params.external_link }} href="{{ .Params.external_link }}" {{ end }}>
                                {{ .Title }}
                            </a>
                        </div>
                    </div>
                </div>
                {{ end }}
            </div>
        </div>
    </div>
    {{ if lt $numberOfProjectsToShow $totalProjects }}
    <div class="container has-text-centered top-pad">
        <a href="{{ "/projects" | relURL }}">ALL PROJECTS</a>
    </div>
    {{ end }}
    <!-- End Projects container -->

    <!-- Projects modals -->
    {{ range (.Site.GetPage "section" "projects").Pages | first $numberOfProjectsToShow }} {{ if not .Params.external_link }}
    <div class="modal" id="modal{{ $card := .Title | urlize }}{{ replace $card "%" " "}}">
        <div class="modal-background"></div>
        <div class="modal-card">
            {{ with .Title }}
            <header class="modal-card-header bottom-pad">
                <p class="modal-card-title has-text-centered">{{ . }}</p>
            </header>
            {{ end }} {{ if .Params.image }}
            <img src="{{ .Params.image | relURL }}" class="img-responsive img-centered"> {{ end }} {{ if .Content }}
            <section class="modal-card-body markdown">
                {{ .Content }}
            </section>
            {{ end }}
        </div>
        <button class="modal-close is-large" aria-label="close" id="close{{ $card := .Title | urlize }}{{ replace $card "%" ""}}"></button>
    </div>
    <script>
        $('#project{{ $card := .Title | urlize }}{{ replace $card "%" ""}}').click(function () {
            $('#modal{{ $card := .Title | urlize }}{{ replace $card "%" ""}}').addClass('is-active');
        });
        $('#close{{ $card := .Title | urlize }}{{ replace $card "%" ""}}').click(function () {
            $('#modal{{ $card := .Title | urlize }}{{ replace $card "%" ""}}').removeClass('is-active');
        });
    </script>
    {{ end }} {{ end }}


    <div class="container has-text-centered top-pad">
        <a href="#top">
            <i class="fa fa-arrow-up"></i>
        </a>
    </div>