Skip to content

Commit 2b8a733

Browse files
committed
More meaningful html structure
1 parent b3b0f03 commit 2b8a733

File tree

3 files changed

+64
-61
lines changed

3 files changed

+64
-61
lines changed

LinkDotNet.Blog.Web/Pages/Index.razor

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@
66
@inject AppConfiguration _appConfiguration
77

88
<OgData Title="@(Markdown.ToPlainText(_appConfiguration.Introduction.Description))" PreviewImageUrl="@_appConfiguration.Introduction.BackgroundUrl"></OgData>
9+
<section>
10+
<IntroductionCard Introduction="_appConfiguration.Introduction"></IntroductionCard>
911

10-
<IntroductionCard Introduction="_appConfiguration.Introduction"></IntroductionCard>
11-
12-
<div class="content px-4">
13-
@for (var i = 0; i < _blogPosts.Count; i++)
14-
{
15-
<ShortBlogPost BlogPost="_blogPosts[i]" UseAlternativeStyle="@(i % 2 != 0)"></ShortBlogPost>
16-
}
17-
</div>
18-
12+
<div class="content px-4">
13+
@for (var i = 0; i < _blogPosts.Count; i++)
14+
{
15+
<ShortBlogPost BlogPost="_blogPosts[i]" UseAlternativeStyle="@(i % 2 != 0)"></ShortBlogPost>
16+
}
17+
</div>
18+
</section
1919
@code {
2020
IList<BlogPost> _blogPosts = new List<BlogPost>();
2121
protected override async Task OnInitializedAsync()
Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
11
@inject AppConfiguration _configuration
22

3-
<nav class="nav">
4-
<div class="container">
5-
<div class="logo">
6-
<a href="#">@_configuration.BlogName</a>
3+
<header>
4+
<nav class="nav">
5+
<div class="container">
6+
<div class="logo">
7+
<a href="#">@_configuration.BlogName</a>
8+
</div>
9+
<div id="mainListDiv" class="main_list">
10+
<ul class="navlinks">
11+
<li><a href="#">Home</a></li>
12+
@if (_configuration.HasLinkedinAccount)
13+
{
14+
<li><a target="_blank" href="@_configuration.LinkedinAccountUrl"><i class="fab fa-linkedin"></i> LinkedIn</a></li>
15+
}
16+
@if (_configuration.HasGithubAccount)
17+
{
18+
<li><a target="_blank" href="@_configuration.GithubAccountUrl"><i class="fab fa-github"></i> Github</a></li>
19+
}
20+
<li><AccessControl></AccessControl></li>
21+
</ul>
22+
</div>
23+
<span class="navTrigger">
24+
<i></i>
25+
<i></i>
26+
<i></i>
27+
</span>
728
</div>
8-
<div id="mainListDiv" class="main_list">
9-
<ul class="navlinks">
10-
<li><a href="#">Home</a></li>
11-
@if (_configuration.HasLinkedinAccount)
12-
{
13-
<li><a target="_blank" href="@_configuration.LinkedinAccountUrl"><i class="fab fa-linkedin"></i> LinkedIn</a></li>
14-
}
15-
@if (_configuration.HasGithubAccount)
16-
{
17-
<li><a target="_blank" href="@_configuration.GithubAccountUrl"><i class="fab fa-github"></i> Github</a></li>
18-
}
19-
<li><AccessControl></AccessControl></li>
20-
</ul>
21-
</div>
22-
<span class="navTrigger">
23-
<i></i>
24-
<i></i>
25-
<i></i>
26-
</span>
27-
</div>
28-
</nav>
29+
</nav>
30+
</header>

LinkDotNet.Blog.Web/Shared/ShortBlogPost.razor

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,35 @@
33
@using System.Web
44
@inject NavigationManager _navigationManager
55
@inherits MarkdownComponentBase
6-
<div class="blog-card @AltCssClass">
7-
<div class="meta">
8-
<div class="photo" style="background-image: url(@BlogPost.PreviewImageUrl)"></div>
9-
<ul class="details">
10-
<li class="date">@BlogPost.UpdatedDate.ToString("dd/MM/yyyy")</li>
11-
@if (BlogPost.Tags != null)
12-
{
13-
<li class="tags">
14-
<ul>
15-
@foreach (var tag in BlogPost.Tags.Select(t => t.Content))
16-
{
17-
<li><a href="/searchByTag/@(Uri.EscapeDataString(tag))">@tag</a></li>
18-
}
19-
</ul>
20-
</li>
21-
}
22-
</ul>
6+
<article>
7+
<div class="blog-card @AltCssClass">
8+
<div class="meta">
9+
<div class="photo" style="background-image: url(@BlogPost.PreviewImageUrl)"></div>
10+
<ul class="details">
11+
<li class="date">@BlogPost.UpdatedDate.ToString("dd/MM/yyyy")</li>
12+
@if (BlogPost.Tags != null)
13+
{
14+
<li class="tags">
15+
<ul>
16+
@foreach (var tag in BlogPost.Tags.Select(t => t.Content))
17+
{
18+
<li><a href="/searchByTag/@(Uri.EscapeDataString(tag))">@tag</a></li>
19+
}
20+
</ul>
21+
</li>
22+
}
23+
</ul>
24+
</div>
25+
<div class="description">
26+
<h1>@BlogPost.Title</h1>
27+
<h2></h2>
28+
<p>@RenderMarkupString(BlogPost.ShortDescription)</p>
29+
<p class="read-more">
30+
<a href="#" @onclick="@OpenBlogPost">Read More</a>
31+
</p>
32+
</div>
2333
</div>
24-
<div class="description">
25-
<h1>@BlogPost.Title</h1>
26-
<h2></h2>
27-
<p>@RenderMarkupString(BlogPost.ShortDescription)</p>
28-
<p class="read-more">
29-
<a href="#" @onclick="@OpenBlogPost">Read More</a>
30-
</p>
31-
</div>
32-
</div>
33-
34+
</article>
3435
@code {
3536
[Parameter]
3637
public BlogPost BlogPost { get; set; }

0 commit comments

Comments
 (0)