Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Showing list of all ADRs on /adr page. #189

Merged
merged 1 commit into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>