Skip to content

Commit

Permalink
Merge pull request #31 from Sharp0802/dev
Browse files Browse the repository at this point in the history
Refactoring for developers
  • Loading branch information
Sharp0802 authored Oct 5, 2023
2 parents 2835d67 + 1720f61 commit fab6857
Show file tree
Hide file tree
Showing 24 changed files with 146 additions and 65 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
test/

# Created by https://www.toptal.com/developers/gitignore/api/csharp,dotnetcore,rider,visualstudiocode,visualstudio
# Edit at https://www.toptal.com/developers/gitignore?templates=csharp,dotnetcore,rider,visualstudiocode,visualstudio

Expand Down
1 change: 1 addition & 0 deletions src/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea/
13 changes: 0 additions & 13 deletions src/.idea/.idea.BlogMan/.idea/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion src/.idea/.idea.BlogMan/.idea/.name

This file was deleted.

4 changes: 0 additions & 4 deletions src/.idea/.idea.BlogMan/.idea/encodings.xml

This file was deleted.

11 changes: 0 additions & 11 deletions src/.idea/.idea.BlogMan/.idea/indexLayout.xml

This file was deleted.

This file was deleted.

6 changes: 0 additions & 6 deletions src/.idea/.idea.BlogMan/.idea/jsLibraryMappings.xml

This file was deleted.

6 changes: 0 additions & 6 deletions src/.idea/.idea.BlogMan/.idea/vcs.xml

This file was deleted.

19 changes: 19 additions & 0 deletions src/BlogMan.Test/Resources/post/test0/align-0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
LCID: ko-kr
Layout: default
Title: Alignment Test 0
Timestamps:
- 2023-10-04
- 2023-10-05
- 2023-10-06
Topic: [
"test-topic-0",
"test-topic-1"
]
---

## Hello There!

[test-link-1](ref::test/test-post-1.md)

[test-link-2](ref::test/test/test-post-2.md)
19 changes: 19 additions & 0 deletions src/BlogMan.Test/Resources/post/test0/align-1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
LCID: ko-kr
Layout: default
Title: Alignment Test 1
Timestamps:
- 2023-10-04
- 2023-10-05
- 2023-10-06
Topic: [
"test-topic-0",
"test-topic-1"
]
---

## Hello There!

[test-link-1](ref::test/test-post-1.md)

[test-link-2](ref::test/test/test-post-2.md)
19 changes: 19 additions & 0 deletions src/BlogMan.Test/Resources/post/test0/align-2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
LCID: ko-kr
Layout: default
Title: Alignment Test 2
Timestamps:
- 2023-10-04
- 2023-10-05
- 2023-10-06
Topic: [
"test-topic-0",
"test-topic-1"
]
---

## Hello There!

[test-link-1](ref::test/test-post-1.md)

[test-link-2](ref::test/test/test-post-2.md)
19 changes: 19 additions & 0 deletions src/BlogMan.Test/Resources/post/test0/align-3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
LCID: ko-kr
Layout: default
Title: Alignment Test 3
Timestamps:
- 2023-10-04
- 2023-10-05
- 2023-10-06
Topic: [
"test-topic-0",
"test-topic-1"
]
---

## Hello There!

[test-link-1](ref::test/test-post-1.md)

[test-link-2](ref::test/test/test-post-2.md)
19 changes: 19 additions & 0 deletions src/BlogMan.Test/Resources/post/test0/align-4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
LCID: ko-kr
Layout: default
Title: Alignment Test 4
Timestamps:
- 2023-10-04
- 2023-10-05
- 2023-10-06
Topic: [
"test-topic-0",
"test-topic-1"
]
---

## Hello There!

[test-link-1](ref::test/test-post-1.md)

[test-link-2](ref::test/test/test-post-2.md)
19 changes: 19 additions & 0 deletions src/BlogMan.Test/Resources/post/test0/test1/test-post-eee.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
LCID: ko-kr
Layout: default
Title: Welcome!
Timestamps:
- 2023-10-04
- 2023-10-05
- 2023-10-06
Topic: [
"test-topic-0",
"test-topic-1"
]
---

## Hello There!

[test-link-1](ref::test0/test-post-1.md)

[test-link-2](ref::test0/test1/test-post-2.md)
19 changes: 19 additions & 0 deletions src/BlogMan.Test/Resources/post/test0/test2/test-post-ddd.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
LCID: ko-kr
Layout: default
Title: Welcome!
Timestamps:
- 2023-10-04
- 2023-10-05
- 2023-10-06
Topic: [
"test-topic-0",
"test-topic-1"
]
---

## Hello There!

[test-link-1](ref::test0/test-post-1.md)

[test-link-2](ref::test0/test1/test-post-2.md)
File renamed without changes.
2 changes: 1 addition & 1 deletion src/BlogMan.Test/Resources/test.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"RootUri": "https://sharp0802.github.io/",
"PostDirectory": "post/",
"LayoutDirectory": "layout/",
"SiteDirectory": "docs/",
"SiteDirectory": "site/",
"BuildDirectory": "build/"
},
"Profile": {
Expand Down
2 changes: 1 addition & 1 deletion src/BlogMan/Components/RazorTemplateLinker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace BlogMan.Components;

public sealed class RazorTemplateLinker : LinkerBase, IDisposable
public sealed class RazorTemplateLinker : LinkerBase
{
private readonly ConcurrentDictionary<string, string> _layoutMap = new();
private readonly ThreadLocal<MarkdownPipeline> _pipeline = new();
Expand Down
11 changes: 6 additions & 5 deletions src/BlogMan/Components/SEH.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
using System.Security;

namespace BlogMan.Components;

public static class SEH
{
public static bool IO<T>(T target, Action<T>? io)
public static bool IO<T>(T target, Action<T> io)
{
try
{
io?.Invoke(target);
io.Invoke(target);
return true;
}
catch (IOException e)
Expand All @@ -28,13 +29,13 @@ public static bool IO<T>(T target, Action<T>? io)
return false;
}

public static bool IO<TSource, TReturn>(TSource target, Func<TSource, TReturn?>? io, out TReturn? ret)
public static bool IO<TSource, TReturn>(TSource target, Func<TSource, TReturn?> io, [NotNullWhen(true)] out TReturn? ret)
where TReturn : class
{
try
{
ret = io?.Invoke(target);
return true;
ret = io.Invoke(target);
return ret is not null;
}
catch (IOException)
{
Expand Down
4 changes: 1 addition & 3 deletions src/BlogMan/Contexts/SourceGenerationContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,4 @@ namespace BlogMan.Contexts;
[JsonSerializable(typeof(ProfileInfo))]
[JsonSerializable(typeof(ProjectInfo))]
[JsonSerializable(typeof(string))]
public partial class SourceGenerationContext : JsonSerializerContext
{
}
public partial class SourceGenerationContext : JsonSerializerContext;
4 changes: 1 addition & 3 deletions src/BlogMan/Models/Abstraction/IReadOnlyTree.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
namespace BlogMan.Models.Abstraction;

public interface IReadOnlyTree<out TChild> : IEnumerable<TChild>
{
}
public interface IReadOnlyTree<out TChild> : IEnumerable<TChild>;
3 changes: 2 additions & 1 deletion src/BlogMan/Resources/post.razor
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@
</header>

<main id="article-main" class="markdown-body">
@Raw(Model.Html)

@Raw(Model.Html)
</main>

</body>
Expand Down

0 comments on commit fab6857

Please sign in to comment.