single.html 7.42 KB
Newer Older
Francisco Jesús Acién Pérez's avatar
adding  
Francisco Jesús Acién Pérez committed
1
2
3
{{ define "main" }}
  <div class="main" role="main">
    <article class="article">
4
      <div class="container">
Francisco Jesús Acién Pérez's avatar
adding  
Francisco Jesús Acién Pérez committed
5
6
7
      {{ with .Params.image }}<img src="{{ . }}" class="article-image" />{{ end }}
      {{ with .Params.series }}<p class="article-title-series"><a href="{{ "/" | relURL }}series/{{ index . 0 | urlize }}/">{{ index . 0 }}</a>&nbsp;/</p>{{ end }}
      <h1 class="article-title">{{ .Title }}</h1>
8

Francisco Jesús Acién Pérez's avatar
adding  
Francisco Jesús Acién Pérez committed
9
10
      <hr class="article-title-bottom">
      <ul class="article-meta">
11
        <li class="article-description">{{ .Params.description }}</li>
Francisco Jesús Acién Pérez's avatar
adding  
Francisco Jesús Acién Pérez committed
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
        {{- if .Params.categories }}
        {{- range .Params.categories }}
        <li class="article-meta-categories">
          <a href="{{ "/" | relURL }}categories/{{ . | urlize }}/">
            <i class="fas fa-folder"></i>
            {{ . }}
          </a>&nbsp;
        </li>
        {{- end }}
        {{- end }}
        {{- if .Params.tags }}
        {{- range .Params.tags }}
        <li class="article-meta-tags">
          <a href="{{ "/" | relURL }}tags/{{ . | urlize }}/">
            <i class="fas fa-tag"></i>
            {{ . }}
          </a>&nbsp;
        </li>
        {{- end }}
        {{- end }}
      </ul>
      {{ partial "toc.html" . }}

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
      <div class="article-content">

          {{- if .Params.logo }}
          <div class="row card-row">
            <div class="col card-col">
              <div class="card card-project">
                {{ with .Params.logo }}<img class="card-img-top" src="{{ . }}" alt="Card image cap"> {{ end }}
                <div class="card-body text-center">

                  {{- if .Params.github }}
                  {{ with .Params.github }}<a href="{{ . }}"><i class="fab fa-github fa-lg icon" style="color:#00a9e0"></i></a>{{ end }}
                  {{ end }}

                  {{- if .Params.gitlab }}
                  {{ with .Params.gitlab }}<a href="{{ . }}"><i class="fab fa-gitlab fa-lg icon" style="color:#00a9e0"></i></a>{{ end }}
                  {{ end }}

                  {{- if .Params.docs }}
                  {{ with .Params.docs }}<a href="{{ . }}"><i class="fas fa-book fa-lg icon" style="color:#00a9e0"></i></a>{{ end }}
                  {{ end }}

                  {{- if .Params.docker }}
                  {{ with .Params.docker }}<a href="{{ . }}"><i class="fab fa-docker fa-lg icon" style="color:#00a9e0"></i></a>{{ end }}
                  {{ end }}

                  {{- if .Params.pypi }}
                  {{ with .Params.pypi }}<a href="{{ . }}"><i class="fab fa-python fa-lg icon" style="color:#00a9e0"></i></a>{{ end }}
                  {{ end }}
                </div>
              </div>

              {{- if .Params.demos }}
                {{- if gt (len .Params.demos) 1 }}
                  <div class="card text-center card-project">
                    <div class="card-header">
                      <ul class="nav nav-tabs card-header-tabs">
                        {{ range $index, $vale := .Params.demos }}
                          {{ range where $.Site.Pages "File.BaseFileName" . }}
                            <li class="nav-item">
                              <a class="nav-link {{- if eq $index 0 }} show active {{ end }}" id="{{ .Params.id }}-tab" data-toggle="tab" href="#{{ .Params.id }}" role="tab" aria-controls="{{ .Params.id }}" aria-selected="true"> Demo {{ add $index 1 }}</a>
                            </li>
                          {{ end }}
                        {{ end }}
                      </ul>
                    </div>

                    <div class="tab-content" id="myTabContent">
                      {{ range $index, $vale := .Params.demos }}
                        {{ range where $.Site.Pages "File.BaseFileName" . }}
                          <div class="card-body tab-pane fade {{- if eq $index 0 }} show active {{ end }}" id="{{ .Params.id }}" role="tabpanel" aria-labelledby="{{ .Params.id }}-tab">
                            <h5 class="card-title"> {{ .Title }}</h5>
                            <p class="card-text"> {{ .Params.subtitle }}</p>
                            <a href="{{ .Params.demo }}" class="btn btn-primary">Show more</a>
                          </div>
                        {{ end }}
                      {{ end }}
                    </div>
                  </div>
                {{- else if eq (len .Params.demos) 1 }}
                  {{ range where $.Site.Pages "File.BaseFileName" ( index .Params.demos 0 ) }}
                    <div class="card card-project">
                      <div class="card-body text-center">
                        <h5 class="card-title"> {{ .Title }}</h5>
                        <p class="card-text"> {{ .Params.subtitle }}</p>
                        <a href=" {{ .Params.demo }}" class="btn btn-primary">Show more</a>
                      </div>
                    </div>
                  {{ end }}
                {{ end }}
                {{ end }}
              </div>
            </div>
            {{ end }}

          {{ .Content }}
        </div>

        <div class="related">
        {{ $relatedPages := slice }}
        {{ if .Params.related }}
          <h3>Related projects</h3>
          <div class="row">
    	        {{ range .Params.related }}
                  {{ range where $.Site.Pages "File.BaseFileName" . }}
                    {{ $relatedPages = $relatedPages | append . }}
                  <div class="col-auto mb-3" style="width: 18rem;">
                    <div class="card">
                      {{ if .Params.logo }}
                      <a href="{{ .RelPermalink }}">{{ with .Params.logo }}<img class="card-img-top" src="{{ . }}" alt="Card image cap">{{ end }}</a>
                      {{ end }}
                      <div class="card-body">
                        <a href="{{ .RelPermalink }}"><h5 class="card-title">{{ .Title }}</h5></a>

                        {{ if .Params.subtitle }}
                        {{ with .Params.subtitle }}<p class="card-text">{{ . }}</p> {{ end }}
                        {{ end }}
                      </div>
                    </div>
                  </div>
                  {{ end }}
    	       {{ end }}
          </div>
          {{ end }}

          <!-- Proyectos similares (con la misma categoria o las mismas tags) -->
          {{ $related := (where .Site.RegularPages "Section" "projects").RelatedIndices . "categories" "tags" | first 5 }}
          {{ $related := $related | complement $relatedPages }} <!-- Delete posts that are on .Params.related -->
          {{ with $related }}
          <h3>See also</h3>
          <div class="row">
    	       {{ range . }}
             <div class="col-auto mb-3" style="width: 18rem;">
              <div class="card">
                {{ if .Params.logo }}
                <a href="{{ .RelPermalink }}">{{ with .Params.logo }}<img class="card-img-top" src="{{ . }}" alt="Card image cap">{{ end }}</a>
                {{ end }}
                <div class="card-body">
                  <a href="{{ .RelPermalink }}"><h5 class="card-title">{{ .Title }}</h5></a>

                  {{ if .Params.subtitle }}
                  {{ with .Params.subtitle }}<p class="card-text">{{ . }}</p> {{ end }}
                  {{ end }}


                </div>
              </div>
            </div>
    	      {{ end }}
          </div>
          {{ end }}
        </div>
      </div>
    </article>
Francisco Jesús Acién Pérez's avatar
adding  
Francisco Jesús Acién Pérez committed
168
169
  </div>
{{ end }}