Skip to content

Commit d8e8678

Browse files
committed
Port Back link to Razor template
1 parent f959d89 commit d8e8678

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

src/GovUk.Frontend.AspNetCore/ComponentGeneration/DefaultComponentGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public virtual ValueTask<IHtmlContent> GenerateAccordionAsync(AccordionOptions o
8484
public virtual ValueTask<IHtmlContent> GenerateBackLinkAsync(BackLinkOptions options)
8585
{
8686
ArgumentNullException.ThrowIfNull(options);
87-
return RenderTemplateAsync("back-link", options);
87+
return RenderViewAsync("BackLink", options);
8888
}
8989

9090
public virtual ValueTask<IHtmlContent> GenerateBreadcrumbsAsync(BreadcrumbsOptions options)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@inherits GovUkComponentView<BackLinkOptions>
2+
3+
<a href="@(Model.Href ?? "#")" class="@Classes("govuk-back-link", Model.Classes)" _gfa-attributes="Model.Attributes" _gfa-trim-content>
4+
@(HtmlOrText(Model.Html, Model.Text, "Back"))
5+
</a>

src/GovUk.Frontend.AspNetCore/ComponentGeneration/Templates/GovUkComponentView.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
namespace GovUk.Frontend.AspNetCore.ComponentGeneration.Templates;
55

66
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
7+
78
public abstract class GovUkComponentView<TModel> : RazorPage<TModel>
89
{
910
protected IHtmlContent? Classes(params object?[] classNames)

src/GovUk.Frontend.AspNetCore/ComponentGeneration/Templates/back-link.liquid

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)