fix: switch to SSR only
- not actually making use of interactive server functionality - don't need to deal with websocket disconnect when server is restarted - can get necessary functionality using static rendering plus executing js on client when loaded - added page script component to handle loading collocated scripts for pages that also work with enhanced navigation
This commit is contained in:
@@ -18,19 +18,22 @@
|
||||
<section role="feed" class="container">
|
||||
@foreach (var post in Posts)
|
||||
{
|
||||
<a href="/@post.Slug">
|
||||
<NavLink href="@GetLink(post)">
|
||||
<article>
|
||||
<h3 title="@post.Title" >@post.Title</h3>
|
||||
<p class="date">@post.PublishedAt.ToString("MMMM d, yyyy")</p>
|
||||
<p class="lead">@post.Lead</p>
|
||||
</article>
|
||||
</a>
|
||||
</NavLink>
|
||||
}
|
||||
</section>
|
||||
}
|
||||
|
||||
@code {
|
||||
@code
|
||||
{
|
||||
private List<Post>? Posts;
|
||||
|
||||
private string GetLink(Post post) => $"/{post.Slug}";
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user