Wave/Wave/Components/ArticleLink.razor
Mia Rose Winter 1e10d41cad
Some checks failed
Build, Tag, Push Docker Image / build (push) Has been cancelled
Create Release / Generate Release (push) Has been cancelled
Implemented custom slugs for articles
2024-02-28 12:20:22 +01:00

22 lines
620 B
Plaintext

@using Wave.Data
@using System.Net
@using System.Web
@using Wave.Utilities
<a href="@Link" target="_top" @attributes="AdditionalAttributes">
@ChildContent
</a>
@code {
[Parameter]
public required Article Article { get; set; }
[Parameter]
public RenderFragment? ChildContent { get; set; }
private string TitleEncoded => Uri.EscapeDataString(Article.Title.ToLowerInvariant()).Replace("-", "+").Replace("%20", "-");
private string Link => ArticleUtilities.GenerateArticleLink(Article, null);
[Parameter(CaptureUnmatchedValues = true)]
public Dictionary<string, object>? AdditionalAttributes { get; set; }
}