Skip to content

Commit 4b71e59

Browse files
committed
Merge branch 'master' of https://github.com/linkdotnet/Blog
# Conflicts: # src/LinkDotNet.Blog.Web/Features/Components/ShortBlogPost.razor
2 parents eabcaf8 + 4df9339 commit 4b71e59

File tree

38 files changed

+1204
-74
lines changed

38 files changed

+1204
-74
lines changed

Directory.Packages.props

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,39 +8,40 @@
88
</ItemGroup>
99
<ItemGroup Label="Infrastructure">
1010
<PackageVersion Include="Azure.Storage.Blobs" Version="12.25.0" />
11-
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="9.0.8" />
12-
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.8" />
13-
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.8" />
11+
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="9.0.9" />
12+
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.9" />
13+
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.9" />
1414
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.8">
1515
<PrivateAssets>all</PrivateAssets>
1616
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1717
</PackageVersion>
18-
<PackageVersion Include="Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions" Version="9.0.8" />
19-
<PackageVersion Include="MongoDB.Driver" Version="3.4.3" />
18+
<PackageVersion Include="Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions" Version="9.0.9" />
19+
<PackageVersion Include="MongoDB.Driver" Version="3.5.0" />
2020
<PackageVersion Include="Pomelo.EntityFrameworkCore.MySql" Version="9.0.0" />
2121
<PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.4" />
2222
<PackageVersion Include="RavenDB.Client" Version="7.1.2" />
2323
</ItemGroup>
2424
<ItemGroup Label="Web">
2525
<PackageVersion Include="AspNetCore.HealthChecks.UI.Client" Version="9.0.0" />
2626
<PackageVersion Include="Blazored.Toast" Version="4.2.1" />
27-
<PackageVersion Include="Blazorise.Bootstrap5" Version="1.8.1" />
28-
<PackageVersion Include="Blazorise.Markdown" Version="1.8.1" />
29-
<PackageVersion Include="Markdig" Version="0.41.3" />
30-
<PackageVersion Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="9.0.8" />
31-
<PackageVersion Include="Microsoft.Extensions.Options" Version="9.0.8" />
32-
<PackageVersion Include="NCronJob" Version="4.5.4" />
27+
<PackageVersion Include="Blazorise.Bootstrap5" Version="1.8.2" />
28+
<PackageVersion Include="Blazorise.Markdown" Version="1.8.2" />
29+
<PackageVersion Include="Markdig" Version="0.42.0" />
30+
<PackageVersion Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="9.0.9" />
31+
<PackageVersion Include="Microsoft.Extensions.Options" Version="9.0.9" />
32+
<PackageVersion Include="NCronJob" Version="4.6.0" />
3333
<PackageVersion Include="ReverseMarkdown" Version="4.7.0" />
34-
<PackageVersion Include="System.ServiceModel.Syndication" Version="9.0.8" />
34+
<PackageVersion Include="System.ServiceModel.Syndication" Version="9.0.9" />
35+
<PackageVersion Include="NetEscapades.AspNetCore.SecurityHeaders" Version="1.1.0"/>
3536
</ItemGroup>
3637
<ItemGroup Label="Tests">
37-
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.8" />
38-
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="9.0.8" />
38+
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.9" />
39+
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="9.0.9" />
3940
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
4041
<PackageVersion Include="NSubstitute" Version="5.3.0" />
4142
<PackageVersion Include="RavenDB.TestDriver" Version="7.1.2" />
4243
<PackageVersion Include="Shouldly" Version="4.3.0" />
43-
<PackageVersion Include="bunit" Version="2.0.49-preview" />
44+
<PackageVersion Include="bunit" Version="2.0.50-preview" />
4445
<PackageVersion Include="coverlet.collector" Version="6.0.4">
4546
<PrivateAssets>all</PrivateAssets>
4647
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
@@ -54,6 +55,6 @@
5455
</ItemGroup>
5556
<ItemGroup Label="Tools">
5657
<PackageVersion Include="CommandLineParser" Version="2.9.1" />
57-
<PackageVersion Include="Microsoft.Playwright" Version="1.54.0" />
58+
<PackageVersion Include="Microsoft.Playwright" Version="1.55.0" />
5859
</ItemGroup>
5960
</Project>

docs/Migrations/Readme.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,8 @@ This is contrasted by Minor changes. These are things where the user does not ne
66

77
Breaking changes are recorded in the [MIGRATION.md](../../MIGRATION.md). Since version 9 of the blog, “Entity Framework Migrations” has been introduced for all SQL providers. You can read more in the [documentation](../Storage/Readme.md). In a nutshell, this means that database migration can be carried out easily via the “ef migration” CLI tool. More on this in the documentation linked above.
88

9-
Changes for the appsettings.json must currently still be made manually. The exact changes that need to be made here can be found in MIGRATION.md.
9+
Changes for the appsettings.json must currently still be made manually. The exact changes that need to be made here can be found in MIGRATION.md.
10+
11+
## UNRELEASED
12+
13+
A new config has been added `UseMultiAuthorMode` in `appsettings.json`. The default value of this config is `false`. If set to `true` then author name will be associated with blog posts at the time of creation.

docs/Setup/Configuration.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ The appsettings.json file has a lot of options to customize the content of the b
6565
"ServiceUrl": "",
6666
"ContainerName": "",
6767
"CdnEndpoint": ""
68-
}
68+
},
69+
"UseMultiAuthorMode": false
6970
}
7071
```
7172

@@ -109,3 +110,4 @@ The appsettings.json file has a lot of options to customize the content of the b
109110
| ServiceUrl | string | The host url of the Azure blob storage. Only used if `AuthenticationMode` is set to `Default` |
110111
| ContainerName | string | The container name for the image storage provider |
111112
| CdnEndpoint | string | Optional CDN endpoint to use for uploaded images. If set, the blog will return this URL instead of the storage account URL for uploaded assets. |
113+
| UseMultiAuthorMode | boolean | The default value is `false`. If set to `true` then author name will be associated with blog posts at the time of creation. This author name will be fetched from the identity provider's `name` or `nickname` or `preferred_username` claim property. |

src/LinkDotNet.Blog.Domain/BlogPost.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ public sealed partial class BlogPost : Entity
3838

3939
public string Slug => GenerateSlug();
4040

41+
public string? AuthorName { get; private set; }
42+
4143
private string GenerateSlug()
4244
{
4345
if (string.IsNullOrWhiteSpace(Title))
@@ -92,7 +94,8 @@ public static BlogPost Create(
9294
DateTime? updatedDate = null,
9395
DateTime? scheduledPublishDate = null,
9496
IEnumerable<string>? tags = null,
95-
string? previewImageUrlFallback = null)
97+
string? previewImageUrlFallback = null,
98+
string? authorName = null)
9699
{
97100
if (scheduledPublishDate is not null && isPublished)
98101
{
@@ -113,6 +116,7 @@ public static BlogPost Create(
113116
IsPublished = isPublished,
114117
Tags = tags?.Select(t => t.Trim()).ToImmutableArray() ?? [],
115118
ReadingTimeInMinutes = ReadingTimeCalculator.CalculateReadingTime(content),
119+
AuthorName = authorName
116120
};
117121

118122
return blogPost;
@@ -143,5 +147,6 @@ public void Update(BlogPost from)
143147
IsPublished = from.IsPublished;
144148
Tags = from.Tags;
145149
ReadingTimeInMinutes = from.ReadingTimeInMinutes;
150+
AuthorName = from.AuthorName;
146151
}
147152
}

src/LinkDotNet.Blog.Infrastructure/Migrations/20250830110439_AddAuthorNameInBlogPost.Designer.cs

Lines changed: 253 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)