Преглед на файлове

Add section to feature some posts in the main page (#786)

* Add working-on section

* Remove more posts button in working on

* Rename working-on.html to featured-posts.html

* Iterate posts from config file

* Remove unnecessary code in featured-posts.html

---------

Co-authored-by: Emruz Hossain <hossainemruz@gmail.com>
Bernat Borràs Civil преди 1 година
родител
ревизия
a1188673ad
променени са 1 файла, в които са добавени 23 реда и са изтрити 0 реда
  1. 23 0
      layouts/partials/sections/featured-posts.html

+ 23 - 0
layouts/partials/sections/featured-posts.html

@@ -0,0 +1,23 @@
+{{ $sectionID := replace (lower .section.name) " " "-"  }}
+{{ if .section.id }}
+  {{ $sectionID = .section.id }}
+{{ end }}
+
+<div class="container-fluid anchor pb-5 recent-posts-section">
+  {{ if not (.section.hideTitle) }}
+    <h1 class="text-center">
+        <span id="{{ $sectionID }}"></span>{{ .section.name }}</h1>
+  {{ else }}
+    <h1 class="text-center" style="display: none">
+        <span id="{{ $sectionID }}"></span>{{ .section.name }}</h1>
+  {{ end }}
+  <div class="container">
+    <div class="row" id="recent-post-cards">
+      {{ range $post := .posts}}
+        {{ with site.GetPage $post }}
+          {{ partial "cards/recent-post.html" . }}
+        {{ end }}
+      {{ end }}
+    </div>
+  </div>
+</div>