From 2e440d438f184fcf5956e2491097f0a4e08bdc3b Mon Sep 17 00:00:00 2001 From: Poonam Gaigole Date: Wed, 3 Jul 2024 12:46:42 +0530 Subject: [PATCH] Showing list of all ADRs on /adr page. --- content/adr/angular-fe.md | 4 ++-- content/adr/angular-routing.md | 4 ++-- content/adr/drupal-9.md | 4 ++-- layouts/shortcodes/adr-list.html | 19 ++++++++++++++----- 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/content/adr/angular-fe.md b/content/adr/angular-fe.md index 9cd9153..baee9d7 100644 --- a/content/adr/angular-fe.md +++ b/content/adr/angular-fe.md @@ -1,6 +1,6 @@ --- -title: 'Adopt Angular for Frontend Development' -date: "2024-07-05" +title: "Adopt Angular for Frontend Development" +date: "2024-06-05" decision: "We will adopt Angular as our frontend framework due to its comprehensive tooling, strong typing with TypeScript, and suitability for building large-scale applications." status: "proposed" categories: diff --git a/content/adr/angular-routing.md b/content/adr/angular-routing.md index e3c34e6..36c9bbe 100644 --- a/content/adr/angular-routing.md +++ b/content/adr/angular-routing.md @@ -1,6 +1,6 @@ --- -title: 'Implement Angular Routing' -date: "2024-07-12" +title: "Implement Angular Routing" +date: "2024-06-12" decision: "We will implement Angular routing to manage navigation and enable lazy loading for improved performance." status: "accepted" categories: diff --git a/content/adr/drupal-9.md b/content/adr/drupal-9.md index 0a6da88..e855eee 100644 --- a/content/adr/drupal-9.md +++ b/content/adr/drupal-9.md @@ -1,6 +1,6 @@ --- -title: 'Drupal 9' -date: "2024-07-05" +title: "Drupal 9" +date: "2024-06-05" decision: "We will adopt Angular as our frontend framework due to its comprehensive tooling, strong typing with TypeScript, and suitability for building large-scale applications." status: "accepted" categories: diff --git a/layouts/shortcodes/adr-list.html b/layouts/shortcodes/adr-list.html index 45211a0..c53d75b 100644 --- a/layouts/shortcodes/adr-list.html +++ b/layouts/shortcodes/adr-list.html @@ -1,8 +1,14 @@ +{{/* Load and minify the adr.scss stylesheet */}} +{{ $adrCSS := resources.Get "adr.scss" | resources.ToCSS | resources.Minify | fingerprint }} + + +{{/* Retrieve all ADR pages from the "adr" section */}} +{{ $adrPages := where $.Site.RegularPages "Section" "adr" }}
- - {{ $category := index .Page.Params.categories 0 }} - {{ range where .Site.RegularPages "Type" "adrs" }} - {{ if in .Params.categories $category }} + {{/* Check if there are any ADR pages available */}} + {{ if gt (len $adrPages) 0 }} + {{/* Loop through each ADR page */}} + {{ range $adrPages }}
{{ .Params.status }} @@ -14,10 +20,13 @@

{{ .Title }}

- {{ .Params.date }} + {{ .Params.date.Format "2006-01-02" }}
+ {{ else }} + {{/* Display a message if no ADR pages are found */}} +

No ADR pages found.

{{ end }} {{ end }}