@@ -75,40 +75,39 @@ <h2 class="mb-5" id="title">{{ .Title }}</h2>
75
75
</ nav >
76
76
77
77
<!-- Related Articles Section -->
78
- {{if .Content}}
79
- < section class ="my-3 py-3 " id ="related-articles ">
80
- {{ $c := .Section }}
81
- {{ $p := .Params.Categories }}
82
- {{ $t := .Params.Title }}
83
- {{ $ignore := "alert"}}
84
- < h5 class ="text-center "> Related Articles</ h5 >
85
- < div class ="row ">
86
- {{ range $key, $taxonomy := .Site.Taxonomies.categories }}
87
- {{ if eq $key $p }}
88
- {{ if ne $key $ignore}}
89
- {{ range shuffle ($taxonomy.Pages) | first $.Site.Params.article_count }}
90
- {{ if ne .Title $t }}
91
- < div class ="col-sm-4 my-2 ">
92
- < a href ="{{ .Permalink }} ">
93
- < div class ="card text-center ">
94
- {{ if isset .Params "image" }}
95
- < img class ="card-img-top " {{ with .Params.image }} src ="{{ . }} "{{ end }} alt ="{{ .Params.Title }} ">
96
- {{ end }}
97
- < div class ="card-body ">
98
- < h5 class ="card-title "> {{ .Title }}</ h5 >
99
- < p class ="card-subtitle mb-2 text-muted "> {{ .Params.Description }}</ p >
100
- </ div >
101
- </ div >
102
- </ a >
78
+ {{ $c := .Section }}
79
+ {{ $p := .Params.Categories }}
80
+ {{ $t := .Params.Title }}
81
+ {{ $ignore := "alert"}}
82
+
83
+ {{ range $key, $taxonomy := .Site.Taxonomies.categories }}
84
+ {{ if eq $key $p }}
85
+ {{ if ne $key $ignore}}
86
+ {{ range shuffle ($taxonomy.Pages) | first $.Site.Params.article_count }}
87
+ {{ if ne .Title $t }}
88
+ < section class ="my-3 py-3 " id ="related-articles ">
89
+ < h5 class ="text-center "> Related Articles</ h5 >
90
+ < div class ="row ">
91
+ < div class ="col-sm-4 my-2 ">
92
+ < a href ="{{ .Permalink }} ">
93
+ < div class ="card text-center ">
94
+ {{ if isset .Params "image" }}
95
+ < img class ="card-img-top " {{ with .Params.image }} src ="{{ . }} "{{ end }} alt ="{{ .Params.Title }} ">
96
+ {{ end }}
97
+ < div class ="card-body ">
98
+ < h5 class ="card-title "> {{ .Title }}</ h5 >
99
+ < p class ="card-subtitle mb-2 text-muted "> {{ .Params.Description }}</ p >
100
+ </ div >
103
101
</ div >
104
- {{ end }}
105
- {{ end }}
106
- {{ end }}
107
- {{ end }}
102
+ </ a >
103
+ </ div >
104
+ </ div >
105
+ </ section >
108
106
{{ end }}
109
- </ div >
110
- </ section >
111
- {{end}}
107
+ {{ end }}
108
+ {{ end }}
109
+ {{ end }}
110
+ {{ end }}
112
111
<!-- End of related articles section -->
113
112
114
113
</ div >
0 commit comments