[gimp-web-devel/pat/bootstrap] layouts: new reviewStatus front-matter metadata.



commit f0ae3a239c37621c24284dfb9d27ba8e789efdaa
Author: Jehan <jehan girinstud io>
Date:   Fri Sep 23 19:27:57 2022 +0200

    layouts: new reviewStatus front-matter metadata.
    
    We have many documents in pitiful state, either barely started and unfinished,
    or with years-old outdated information (after more recent changes), and so on.
    
    Adding this front-matter will allow to separate the documents which neeed review
    to the ones we consider in good enough state (not necessarily perfect, but at
    least not completely outdated!) while still keeping the automatic listing of
    section files, this one being very practical in order not to miss any document.

 layouts/_default/section.html | 61 +++++++++++++++++++++++++++++++++----------
 1 file changed, 47 insertions(+), 14 deletions(-)
---
diff --git a/layouts/_default/section.html b/layouts/_default/section.html
index 1e71fc2..a412917 100644
--- a/layouts/_default/section.html
+++ b/layouts/_default/section.html
@@ -14,27 +14,60 @@
 
 
     {{ if ne .Params.show_subs false }}
+      {{ $.Scratch.Set "has_drafts" false }}
     <ul>
       {{ range .Data.Pages }}
-      <li>
-        <a href="{{ .Permalink }}">
-          <b>
-            {{ .Title }}
-          </b>
-        </a>
-
-        {{ if not .Date.IsZero }}
-          <time>
-            {{ .Date.Format (.Site.Params.dateform | default "Jan 02, 2006") }}
-          </time>
-        {{end}}
+        {{ if not (isset .Params "reviewstatus") }}
+        <li>
+          <a href="{{ .Permalink }}">
+            <b>
+              {{ .Title }}
+            </b>
+          </a>
+
+          {{ if not .Date.IsZero }}
+            <time>
+              {{ .Date.Format (.Site.Params.dateform | default "Jan 02, 2006") }}
+            </time>
+          {{end}}
 
-      </li>
+        </li>
+        {{else}}
+          {{ $.Scratch.Set "has_drafts" true }}
+        {{end}}
       {{ end }}
     </ul>
-    {{ end }}
 
+      {{ if ($.Scratch.Get "has_drafts") }}
+        <h2 id="drafts">Documents to Review</h2>
+        <p> The following documents are in to be reviewed. They may be
+        incomplete drafts, outdated, in need of completion after recent changes
+        or some other reason.
+        Therefore they should be read with a more critical mind.</p>
+    <ul>
+        {{ range .Data.Pages }}
+          {{ if isset .Params "reviewstatus" }}
+          <li>
+            <a href="{{ .Permalink }}">
+              <b>
+                {{ .Title }}
+              </b>
+            </a>
+
+            {{ if not .Date.IsZero }}
+              <time>
+                {{ .Date.Format (.Site.Params.dateform | default "Jan 02, 2006") }}
+              </time>
+            {{end}}
 
+            (review reason: {{ .Params.reviewstatus }})
+          </li>
+          {{ end }}
+        {{ end }}
+    </ul>
+      {{end }}
+
+    {{ end }}
 
   </section>
 </div>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]