Skip to content

Commit 004d186

Browse files
committed
reformat based on editorconfig
1 parent b73688f commit 004d186

13 files changed

+109
-102
lines changed

BlazorStaticMinimalBlog.csproj

+17-17
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

3-
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
5-
<Nullable>enable</Nullable>
6-
<ImplicitUsings>enable</ImplicitUsings>
7-
</PropertyGroup>
3+
<PropertyGroup>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
</PropertyGroup>
88

9-
<ItemGroup >
10-
<PackageReference Include="BlazorStatic" Version="1.0.0-beta.13"/>
11-
</ItemGroup>
9+
<ItemGroup>
10+
<PackageReference Include="BlazorStatic" Version="1.0.0-beta.13"/>
11+
</ItemGroup>
1212

13-
<ItemGroup>
14-
<None Update="Content/**/*">
15-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
16-
</None>
17-
</ItemGroup>
13+
<ItemGroup>
14+
<None Update="Content/**/*">
15+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
16+
</None>
17+
</ItemGroup>
1818

1919

20-
<!-- to make hot reload work on .md files -->
21-
<ItemGroup>
22-
<Watch Include="Content/**/*"/>
23-
</ItemGroup>
20+
<!-- to make hot reload work on .md files -->
21+
<ItemGroup>
22+
<Watch Include="Content/**/*"/>
23+
</ItemGroup>
2424

2525

2626
</Project>

Components/App.razor

+7-7
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<html lang="en">
33

44
<head>
5-
<meta charset="utf-8" />
6-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<base href="/" />
5+
<meta charset="utf-8"/>
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
7+
<base href="/"/>
88
<script src="https://cdn.tailwindcss.com?plugins=typography"></script>
99
<script>
1010
tailwind.config = {
@@ -17,13 +17,13 @@
1717
},},
1818
}
1919
</script>
20-
21-
22-
<HeadOutlet />
20+
21+
22+
<HeadOutlet/>
2323
</head>
2424

2525
<body class="bg-gray-950 font-sans text-gray-200">
26-
<Routes />
26+
<Routes/>
2727
</body>
2828

2929
</html>

Components/Layout/MainLayout.razor

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
</a>
2323
</div>
2424
<div class="mb-2 flex space-x-2 text-sm text-gray-400">
25-
<a target="_blank" rel="noopener noreferrer" href="https://github.com/tesar-tech/blazorStatic"> Built with Blazor Static</a>
25+
<a target="_blank" rel="noopener noreferrer" href="https://github.com/tesar-tech/blazorStatic"> Built with Blazor Static</a>
2626
<div>•</div>
2727
<div@DateTime.Now.Year</div>
2828
</div>

Components/Layout/NavMenu.razor

+10-9
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<header class="flex items-center justify-between py-10">
44
<div>
5-
<a href="">
5+
<a href="">
66
<div class="flex items-center justify-between">
77
<div class=" h-6 text-2xl font-semibold sm:block text-primary-800">@WebsiteKeys.Title</div>
88
</div>
@@ -11,13 +11,14 @@
1111
<div class="flex items-center space-x-4 leading-5 sm:space-x-6">
1212
@foreach(var item in menuItems)
1313
{
14-
<NavLink ActiveClass="bg-primary-950 px-2 py-1 rounded-xl" class="hidden font-medium text-gray-100 sm:block"
15-
Match="@(item.Link==""?NavLinkMatch.All:NavLinkMatch.Prefix)" href="@item.Link">@((MarkupString)item.Name)
16-
<Svg Icon="item.Icon"/>
17-
</NavLink>
14+
<NavLink ActiveClass="bg-primary-950 px-2 py-1 rounded-xl" class="hidden font-medium text-gray-100 sm:block"
15+
Match="@(item.Link == "" ? NavLinkMatch.All : NavLinkMatch.Prefix)" href="@item.Link">
16+
@((MarkupString)item.Name)
17+
<Svg Icon="item.Icon"/>
18+
</NavLink>
1819

1920
@* <a class="hidden font-medium text-gray-100 sm:block @(Nm.Uri.EndsWith(item.link)?"":"") " href="@item.link">@item.name</a> *@
20-
}
21+
}
2122
<button id="toggle-button" aria-label="Toggle Menu" class="sm:hidden">
2223
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="h-8 w-8 text-gray-100">
2324
<path fill-rule="evenodd" d="M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z" clip-rule="evenodd"></path>
@@ -32,7 +33,7 @@
3233
</button>
3334
</div>
3435
<nav class="fixed mt-8 h-full">
35-
@foreach (var item in menuItems)
36+
@foreach(var item in menuItems)
3637
{
3738
<div class="px-12 py-4">
3839
<NavLink ActiveClass="underline" class="text-2xl font-bold tracking-widest text-gray-100"
@@ -63,7 +64,7 @@
6364
new("Tags", "tags"),
6465
new("", WebsiteKeys.GitHubRepo, Svg.Icons.Github)
6566
];
66-
67-
67+
68+
6869
record MenuItem(string Name, string Link, Svg.Icons? Icon = null);
6970
}

Components/Pages/Blog.razor

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@page "/"
1+
@page "/"
22
@page "/blog/{fileName}"
33
@using System.Globalization
44
@using BlazorStatic
@@ -14,8 +14,8 @@
1414
<h1 class="font-sans md:leading-14 text-3xl font-extrabold leading-9 tracking-tight text-gray-100 sm:text-4xl sm:leading-10 md:text-6xl">Latest</h1>
1515
<p class="text-lg leading-7 text-gray-400 prose prose-invert">@WebsiteKeys.BlogLead</p>
1616
</div>
17-
18-
<PostsList />
17+
18+
<PostsList/>
1919
</div>
2020
return;
2121
}
@@ -51,7 +51,7 @@
5151
<dt class="sr-only">Authors</dt>
5252
<dd>
5353
<ul class="flex flex-wrap justify-center gap-4 sm:space-x-12 xl:block xl:space-x-0 xl:space-y-8">
54-
@foreach (var author in post.FrontMatter.Authors)
54+
@foreach(var author in post.FrontMatter.Authors)
5555
{
5656
<li class="flex items-center space-x-2">
5757
@* <img alt="avatar" loading="lazy" width="38" height="38" decoding="async" data-nimg="1" class="h-10 w-10 rounded-full" srcset="/_next/image?url=%2Fstatic%2Fimages%2Favatar.png&amp;w=48&amp;q=75 1x, /_next/image?url=%2Fstatic%2Fimages%2Favatar.png&amp;w=96&amp;q=75 2x" src="/_next/image?url=%2Fstatic%2Fimages%2Favatar.png&amp;w=96&amp;q=75" style="color: transparent;"/> *@
@@ -94,7 +94,7 @@
9494
<div class="py-4 xl:py-8">
9595
<h2 class="text-xs uppercase tracking-wide text-gray-400">Tags</h2>
9696
<div class="flex flex-wrap">
97-
@foreach (var tag in post.FrontMatter.Tags)
97+
@foreach(var tag in post.FrontMatter.Tags)
9898
{
9999
<a class="text-primary-500 hover:text-primary-400 mr-3 text-sm font-medium uppercase" href="@blazorStaticContentService.Options.TagsPageUrl/@tag">@tag</a>
100100
}
@@ -113,10 +113,10 @@
113113
@code{
114114
[Parameter] public string? FileName { get; set; }
115115
Post<BlogFrontMatter>? post;
116-
116+
117117
protected override void OnInitialized()
118118
{
119119
if (string.IsNullOrWhiteSpace(FileName)) return;
120120
post = blazorStaticContentService.Posts.FirstOrDefault(x => x.Url == FileName);
121121
}
122-
}
122+
}

Components/Pages/Tags.razor

+12-11
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
.Select(group => new { Tag = group.Key, Count = group.Count() })
1616
.OrderByDescending(x => x.Count);
1717

18-
foreach (var tag in tagsWithCount)
18+
foreach(var tag in tagsWithCount)
1919
{
2020
<a class="text-primary-500 hover:text-primary-400 mr-3 text-sm font-medium uppercase" href="@blazorStaticContentService.Options.TagsPageUrl/@WebUtility.HtmlEncode(tag.Tag)">@tag.Tag (@tag.Count)</a>
2121
}
@@ -28,23 +28,24 @@
2828
<div class="divide-y divide-gray-700">
2929
<div class="space-y-2 pb-8 pt-6 md:space-y-5">
3030
<h1 class="font-sans md:leading-14 text-3xl font-extrabold leading-9 tracking-tight text-gray-100 sm:text-4xl sm:leading-10 md:text-6xl">@TagName</h1>
31-
<p class="text-lg leading-7 text-gray-400">Blog posts tagged by
32-
<span class="text-primary-300">@TagName</span>
33-
</p>
31+
<p class="text-lg leading-7 text-gray-400">
32+
Blog posts tagged by
33+
<span class="text-primary-300">@TagName</span>
34+
</p>
3435
</div>
35-
<PostsList Posts="posts"/>
36+
<PostsList Posts="posts"/>
3637
</div>
3738

3839
@code {
39-
40+
4041
[Parameter] public string? TagName { get; set; }
41-
42+
4243
List<Post<BlogFrontMatter>>? posts;
43-
44+
4445
protected override void OnInitialized()
4546
{
4647
if (string.IsNullOrWhiteSpace(TagName)) return;
47-
posts = blazorStaticContentService.Posts.Where(x => x.FrontMatter.Tags.Contains(TagName)).ToList();
48+
posts = blazorStaticContentService.Posts.Where(x => x.FrontMatter.Tags.Contains(TagName)).ToList();
4849
}
49-
50-
}
50+
51+
}

Components/PostsList.razor

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
@inject BlazorStaticService blazorStaticService
66

77
<ul class="divide-y divide-gray-700">
8-
@foreach (var post in posts.OrderByDescending(x => x.FrontMatter.Published))
8+
@foreach(var post in posts.OrderByDescending(x => x.FrontMatter.Published))
99
{
1010
<li class="py-12">
1111
<article>
@@ -27,7 +27,7 @@
2727
<a class="text-gray-100" href="@blazorStaticContentService.Options.PageUrl/@(post.Url)">@post.FrontMatter.Title</a>
2828
</h2>
2929
<div class="flex flex-wrap">
30-
@foreach (var tag in post.FrontMatter.Tags)
30+
@foreach(var tag in post.FrontMatter.Tags)
3131
{
3232
<a class="text-primary-500 hover:text-primary-400 mr-3 text-sm font-medium uppercase" href="@blazorStaticContentService.Options.TagsPageUrl/@tag">@tag</a>
3333
}
@@ -58,4 +58,4 @@
5858
posts = Posts != null ? Posts.OrderBy(x => x.FrontMatter.Published).ToList() : blazorStaticContentService.Posts;
5959
base.OnInitialized();
6060
}
61-
}
61+
}

Components/Routes.razor

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Router AppAssembly="@typeof(Program).Assembly">
22
<Found Context="routeData">
3-
<RouteView RouteData="@routeData" DefaultLayout="@typeof(Layout.MainLayout)" />
4-
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
3+
<RouteView RouteData="@routeData" DefaultLayout="@typeof(Layout.MainLayout)"/>
4+
<FocusOnNavigate RouteData="@routeData" Selector="h1"/>
55
</Found>
66
</Router>

Components/Svg.razor

+3-6
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,12 @@
1616
@code {
1717
[Parameter, EditorRequired] public Icons? Icon { get; set; }
1818
[Parameter] public string SizeClasses { get; set; } = "h-6 w-6";
19-
public enum Icons{
20-
X,
21-
Github
22-
}
23-
19+
public enum Icons { X, Github }
20+
2421
string IconToViewBox(Icons? icon) => icon switch
2522
{
2623
Icons.X => "0 0 50 50",
2724
Icons.Github => "0 0 24 24",
2825
_ => "0 0 24 24"
2926
};
30-
}
27+
}

Content/Blog/second-post.md

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Second post
3-
lead: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla nec purus feugiat, molestie ipsum et, consequat nibh. Etiam non elit dui.
3+
lead: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla nec purus feugiat, molestie ipsum et, consequat nibh. Etiam non elit dui.
44
published: 2023-11-05
55
tags: [tag-001, another-sample-tag]
66
authors:
@@ -9,8 +9,13 @@ authors:
99
xUserName: "tesar_tech"
1010
---
1111

12-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla nec purus feugiat, molestie ipsum et, consequat nibh. Etiam non elit dui. Nullam vel eros sit amet arcu vestibulum accumsan in in leo. Fusce malesuada vulputate faucibus. Integer in hendrerit nisi. Praesent a hendrerit urna. In non imperdiet elit, sed molestie odio. Fusce ac metus non purus sollicitudin laoreet.
13-
Vestibulum quis lacinia eros. Fusce ac metus non purus sollicitudin laoreet. Praesent a hendrerit urna. In non imperdiet elit, sed molestie odio. Fusce ac metus non purus sollicitudin laoreet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
12+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla nec purus feugiat, molestie ipsum et, consequat nibh.
13+
Etiam non elit dui. Nullam vel eros sit amet arcu vestibulum accumsan in in leo. Fusce malesuada vulputate faucibus.
14+
Integer in hendrerit nisi. Praesent a hendrerit urna. In non imperdiet elit, sed molestie odio. Fusce ac metus non purus
15+
sollicitudin laoreet.
16+
Vestibulum quis lacinia eros. Fusce ac metus non purus sollicitudin laoreet. Praesent a hendrerit urna. In non imperdiet
17+
elit, sed molestie odio. Fusce ac metus non purus sollicitudin laoreet. Lorem ipsum dolor sit amet, consectetur
18+
adipiscing elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
1419

1520

1621

Program.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
var app = builder.Build();
1616

1717
// Configure the HTTP request pipeline.
18-
if (!app.Environment.IsDevelopment())
18+
if(!app.Environment.IsDevelopment())
1919
{
2020
app.UseExceptionHandler("/Error", createScopeForErrors: true);
2121
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
@@ -40,5 +40,4 @@ public static class WebsiteKeys
4040
public const string Title = "BlazorStatic Minimal Blog";
4141
public const string BlogPostStorageAddress = $"{GitHubRepo}/tree/main/Content/Blog";
4242
public const string BlogLead = "Sample blog created with BlazorStatic and TailwindCSS";
43-
4443
}

Properties/launchSettings.json

+31-31
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
11
{
22
"$schema": "http://json.schemastore.org/launchsettings.json",
3-
"iisSettings": {
4-
"windowsAuthentication": false,
5-
"anonymousAuthentication": true,
6-
"iisExpress": {
7-
"applicationUrl": "http://localhost:6196",
8-
"sslPort": 44359
3+
"iisSettings": {
4+
"windowsAuthentication": false,
5+
"anonymousAuthentication": true,
6+
"iisExpress": {
7+
"applicationUrl": "http://localhost:6196",
8+
"sslPort": 44359
9+
}
10+
},
11+
"profiles": {
12+
"http": {
13+
"commandName": "Project",
14+
"dotnetRunMessages": true,
15+
"launchBrowser": true,
16+
"applicationUrl": "http://localhost:5077",
17+
"environmentVariables": {
18+
"ASPNETCORE_ENVIRONMENT": "Development"
19+
}
20+
},
21+
"https": {
22+
"commandName": "Project",
23+
"dotnetRunMessages": true,
24+
"launchBrowser": true,
25+
"applicationUrl": "https://localhost:7103;http://localhost:5077",
26+
"environmentVariables": {
27+
"ASPNETCORE_ENVIRONMENT": "Development"
928
}
1029
},
11-
"profiles": {
12-
"http": {
13-
"commandName": "Project",
14-
"dotnetRunMessages": true,
15-
"launchBrowser": true,
16-
"applicationUrl": "http://localhost:5077",
17-
"environmentVariables": {
18-
"ASPNETCORE_ENVIRONMENT": "Development"
19-
}
20-
},
21-
"https": {
22-
"commandName": "Project",
23-
"dotnetRunMessages": true,
24-
"launchBrowser": true,
25-
"applicationUrl": "https://localhost:7103;http://localhost:5077",
26-
"environmentVariables": {
27-
"ASPNETCORE_ENVIRONMENT": "Development"
28-
}
29-
},
30-
"IIS Express": {
31-
"commandName": "IISExpress",
32-
"launchBrowser": true,
33-
"environmentVariables": {
34-
"ASPNETCORE_ENVIRONMENT": "Development"
35-
}
30+
"IIS Express": {
31+
"commandName": "IISExpress",
32+
"launchBrowser": true,
33+
"environmentVariables": {
34+
"ASPNETCORE_ENVIRONMENT": "Development"
3635
}
3736
}
3837
}
38+
}

0 commit comments

Comments
 (0)