Skip to content

Commit 5838cec

Browse files
author
Ajay kumar
committed
[Blog] [Ajay]: Fix tags
1 parent e0a24ef commit 5838cec

File tree

3 files changed

+70
-65
lines changed

3 files changed

+70
-65
lines changed

TestArena/Blog/BlogHome.razor

Lines changed: 13 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,18 @@
11
@page "/"
22
@using TestArena.Blog.Common
3-
<h2 class="mb-4">Latest Blogs</h2>
4-
<div class="row row-cols-1 row-cols-md-3 g-4">
5-
<div class="col">
6-
<Thumbnail ImageUrl="images/blog/pact/intro/header_landscape.png"
7-
Title="Contract testing using PACT in dotnet core: Introduction" Author="Ajay kumar"
8-
Date="@DateTime.Today.Date.ToLongDateString()" Category="Pact contract testing"
9-
BlogUrl="/blog/contract-testing-pact-net-intro" />
10-
</div>
11-
<div class="col">
12-
<Thumbnail ImageUrl="images/blog/pact/events-demo/contract-testing-events.webp"
13-
Title="Intro to PACT for .NET Core: Events Based Systems" Author="Ajay kumar"
14-
Date="@DateTime.Today.Date.ToLongDateString()" Category="Pact contract testing"
15-
BlogUrl="/blog/contract-testing-in-pact-with-events" />
16-
</div>
17-
<div class="col">
18-
<Thumbnail ImageUrl="images/blog/pact/pact-broker/blog_header.png"
19-
Title="Intro to PACT for .NET Core: Integration with PactFlow" Author="Ajay kumar"
20-
Date="@DateTime.Today.Date.ToLongDateString()" Category="Pact contract testing"
21-
BlogUrl="/blog/integration-with-pactflow" />
22-
</div>
23-
<div class="col">
24-
<Thumbnail ImageUrl="images/blog/integration-testing/intro/banner.png"
25-
Title="Integration testing for dotnet core APIs: Introduction" Author="Ajay kumar"
26-
Date="@DateTime.Today.Date.ToLongDateString()" Category="Integration testing"
27-
BlogUrl="/blog/integration-testing-in-dotnet-intro" />
28-
</div>
29-
<div class="col">
30-
<Thumbnail ImageUrl="images/blog/integration-testing/handling-database/banner.png"
31-
Title="Integration testing for dotnet core APIs: Handling database" Author="Ajay kumar"
32-
Date="@DateTime.Today.Date.ToLongDateString()" Category="Integration testing"
33-
BlogUrl="/blog/integration-testing-in-dotnet-with-database" />
34-
</div>
3+
@using TestArena.Blog.Common.NavigationUtils
354

36-
<div class="col">
37-
<Thumbnail ImageUrl="images/blog/integration-testing/handling-external-services/banner.png"
38-
Title="Integration testing for dotnet core APIs: Handling 3rd party service calls using wiremock" Author="Ajay kumar"
39-
Date="@DateTime.Today.Date.ToLongDateString()" Category="Integration testing"
40-
BlogUrl="/blog/integration-testing-in-dotnet-with-external-services" />
41-
</div>
5+
<h2 class="mb-4">Latest Blogs</h2>
6+
<div class="row row-cols-1 row-cols-md-3 g-4 p-2">
427

43-
<div class="col">
44-
<Thumbnail ImageUrl="images/blog/integration-testing/handling-auth/banner.png"
45-
Title="Integration testing for dotnet core APIs: Handling authentication" Author="Ajay kumar"
46-
Date="@DateTime.Today.Date.ToLongDateString()" Category="Integration testing"
47-
BlogUrl="/blog/integration-testing-in-dotnet-with-auth" />
48-
</div>
8+
@{
9+
foreach (var articlePage in SiteMap.Pages)
10+
{
11+
<div class="col">
12+
<Thumbnail ImageUrl="@articlePage.ArticleImage" Title="@articlePage.Header" Author="Ajay kumar"
13+
Date="@articlePage.PublishedOn.ToLongDateString()" Category="@articlePage.Tags"
14+
BlogUrl="@articlePage.RelativePath" />
15+
</div>
16+
}
17+
}
4918
</div>

TestArena/Blog/Common/NavigationUtils/SiteMap.cs

Lines changed: 50 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,58 @@ namespace TestArena.Blog.Common.NavigationUtils
44
{
55
public static class SiteMap
66
{
7-
public static List<PageInfo> Pages { get; } = new List<PageInfo>
8-
{
9-
new("Intro to PACT for .NET Core: API contract testing", "/blog/contract-testing-pact-net-intro"),
10-
new("Intro to PACT for .NET Core: Events based systems", "/blog/contract-testing-in-pact-with-events"),
11-
new("Intro to PACT for .NET Core: Integration with PactFlow", "/blog/integration-with-pactflow"),
12-
new("Integration testing for dotnet core APIs: Introduction", "/blog/integration-testing-in-dotnet-intro"),
13-
new("Integration testing for dotnet core APIs: Handling database", "/blog/integration-testing-in-dotnet-with-database"),
14-
new("Integration testing for dotnet core APIs: Handling APIs behind authentication", "/blog/integration-testing-in-dotnet-with-auth"),
15-
new("Integration testing for dotnet core APIs: Handling 3rd party service calls using wiremock", "/blog/integration-testing-in-dotnet-with-external-services"),
16-
};
7+
public static List<PageInfo> Pages { get; } =
8+
[
9+
new("Intro to PACT for .NET Core: API contract testing",
10+
"/blog/contract-testing-pact-net-intro",
11+
new DateTime(2024, 12, 14),
12+
"images/blog/pact/intro/header_landscape.png",
13+
["PACT", "API"]),
14+
15+
new("Intro to PACT for .NET Core: Events based systems",
16+
"/blog/contract-testing-in-pact-with-events",
17+
new DateTime(2024, 12, 28),
18+
"images/blog/pact/events-demo/contract-testing-events.webp",
19+
["PACT", "Events"]),
20+
21+
new("Intro to PACT for .NET Core: Integration with PactFlow",
22+
"/blog/integration-with-pactflow",
23+
new DateTime(2025, 1, 11),
24+
"images/blog/pact/pact-broker/blog_header.png",
25+
["PACT", "PactFlow"]),
26+
27+
new("Integration testing for dotnet core APIs: Introduction",
28+
"/blog/integration-testing-in-dotnet-intro",
29+
new DateTime(2025, 1, 25),
30+
"images/blog/integration-testing/intro/banner.png",
31+
["Integration Testing", "DotNet"]),
32+
33+
new("Integration testing for dotnet core APIs: Handling database",
34+
"/blog/integration-testing-in-dotnet-with-database",
35+
new DateTime(2025, 2, 8),
36+
"images/blog/integration-testing/handling-database/banner.png",
37+
["Integration Testing", "Database"]),
38+
39+
new("Integration testing for dotnet core APIs: Handling APIs behind authentication",
40+
"/blog/integration-testing-in-dotnet-with-auth",
41+
new DateTime(2025, 2, 22),
42+
"images/blog/integration-testing/handling-auth/banner.png",
43+
["Integration Testing", "Authentication"]),
44+
45+
new("Integration testing for dotnet core APIs: Handling 3rd party service calls using wiremock",
46+
"/blog/integration-testing-in-dotnet-with-external-services",
47+
new DateTime(2025, 3, 8),
48+
"images/blog/integration-testing/handling-external-services/banner.png",
49+
["Integration Testing", "WireMock"])
50+
];
1751
}
1852

19-
public class PageInfo
53+
public class PageInfo(string header, string relativePath, DateTime publishedOn, string articleImage, List<string> tags)
2054
{
21-
public string Header { get; }
22-
public string RelativePath { get; }
23-
24-
public PageInfo(string header, string relativePath)
25-
{
26-
Header = header;
27-
RelativePath = relativePath;
28-
}
55+
public string Header { get; } = header;
56+
public string RelativePath { get; } = relativePath;
57+
public List<string> Tags { get; } = tags;
58+
public DateTime PublishedOn { get; } = publishedOn;
59+
public string ArticleImage { get; } = articleImage;
2960
}
3061
}

TestArena/Blog/Common/Thumbnail.razor

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
@using System.Collections.Generic
2+
13
@code {
24
[Parameter] public string ImageUrl { get; set; } = string.Empty;
35
[Parameter] public string Title { get; set; } = string.Empty;
46
[Parameter] public string Author { get; set; } = string.Empty;
57
[Parameter] public string Date { get; set; } = string.Empty;
6-
[Parameter] public string Category { get; set; } = string.Empty;
8+
[Parameter] public List<string> Category { get; set; } = [];
79
[Parameter] public string BlogUrl { get; set; } = "#";
810
}
911
<style>
@@ -17,7 +19,10 @@
1719
<img src="@ImageUrl" class=" img img-fluid img-thumbnail" alt="@Title">
1820
</a>
1921
<div class="card-body">
20-
<span class="badge bg-primary">@Category</span>
22+
@foreach (var c in Category)
23+
{
24+
<span class="badge bg-primary mx-1">@c</span>
25+
}
2126
<h5 class="card-title mt-2">
2227
<a href="@BlogUrl" class="text-decoration-none text-dark">@Title</a>
2328
</h5>

0 commit comments

Comments
 (0)