Skip to content

Commit

Permalink
Merge pull request #189 from axelerant/feature/adr
Browse files Browse the repository at this point in the history
Showing list of all ADRs on /adr page.
  • Loading branch information
hussainweb authored Jul 3, 2024
2 parents ead4cbf + 2e440d4 commit 9efe451
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
4 changes: 2 additions & 2 deletions content/adr/angular-fe.md
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
4 changes: 2 additions & 2 deletions content/adr/angular-routing.md
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
4 changes: 2 additions & 2 deletions content/adr/drupal-9.md
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
19 changes: 14 additions & 5 deletions layouts/shortcodes/adr-list.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
{{/* Load and minify the adr.scss stylesheet */}}
{{ $adrCSS := resources.Get "adr.scss" | resources.ToCSS | resources.Minify | fingerprint }}
<link rel="stylesheet" href="{{ $adrCSS.Permalink }}" />

{{/* Retrieve all ADR pages from the "adr" section */}}
{{ $adrPages := where $.Site.RegularPages "Section" "adr" }}
<section class="adr-list">
<!--pass the parameter dynamically without passing it in the shortcode call-->
{{ $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 }}
<article class="adr-card">
<section class="adr-meta">
<span class="adr-status">{{ .Params.status }}</span>
Expand All @@ -14,10 +20,13 @@ <h2>{{ .Title }}</h2>
<section class="adr-meta">
<span class="adr-date">
<img src="/svg/calendar.svg" width="20px" alt="" />
<span>{{ .Params.date }}</span>
<span>{{ .Params.date.Format "2006-01-02" }}</span>
</span>
</section>
</article>
{{ else }}
{{/* Display a message if no ADR pages are found */}}
<p>No ADR pages found.</p>
{{ end }}
{{ end }}
</section>

0 comments on commit 9efe451

Please sign in to comment.