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:
Stevan Freeborn
2024-04-13 19:09:03 -05:00
parent 279f80fc97
commit 66bef092f3
12 changed files with 179 additions and 50 deletions
+6 -3
View File
@@ -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()
{