diff --git a/Components/Inputs/EditLinkComponent.razor b/Components/Inputs/EditLinkComponent.razor new file mode 100644 index 0000000..16e5ddf --- /dev/null +++ b/Components/Inputs/EditLinkComponent.razor @@ -0,0 +1,28 @@ + + Edit on GitHub + + + + +@code { + + [Parameter] + public string Href { get; set; } = ""; +} \ No newline at end of file diff --git a/IGP/Database.db b/IGP/Database.db index 39f1680..d686254 100644 Binary files a/IGP/Database.db and b/IGP/Database.db differ diff --git a/IGP/IGP.csproj b/IGP/IGP.csproj index fd3e42b..3717b1c 100644 --- a/IGP/IGP.csproj +++ b/IGP/IGP.csproj @@ -61,4 +61,14 @@ + + <_ContentIncludedByDefault Remove="wwwroot\content\notes\coop\image\notes\map-lostprovince\Map_LostProvince.png" /> + <_ContentIncludedByDefault Remove="wwwroot\image\notes\coop-holdout\CoopBaseLarge.png" /> + <_ContentIncludedByDefault Remove="wwwroot\image\notes\coop-holdout\DefendPoints.png" /> + <_ContentIncludedByDefault Remove="wwwroot\image\notes\coop-holdout\EnemySpawns.png" /> + <_ContentIncludedByDefault Remove="wwwroot\image\notes\coop-holdout\Multipliers.png" /> + <_ContentIncludedByDefault Remove="wwwroot\image\notes\coop-holdout\OpenBases.png" /> + <_ContentIncludedByDefault Remove="wwwroot\image\notes\coop-holdout\Pyre.png" /> + + diff --git a/IGP/Pages/BuildCalculator/BuildCalculatorPage.razor b/IGP/Pages/BuildCalculator/BuildCalculatorPage.razor index 11feb6f..36a13fa 100644 --- a/IGP/Pages/BuildCalculator/BuildCalculatorPage.razor +++ b/IGP/Pages/BuildCalculator/BuildCalculatorPage.razor @@ -207,8 +207,7 @@ padding-left: 2px; padding-right: 2px; } - - + .gridItem { padding: 0px; border: 0px; @@ -264,12 +263,13 @@ var faction = filterService.GetFactionType(); var immortal = filterService.GetImmortalType(); - var entity = EntityModel.GetFrom(hotkey, hotkeyGroup, isHoldSpace, faction, immortal); + EntityModel? entity = EntityModel.GetFrom(hotkey!, hotkeyGroup, isHoldSpace, faction, immortal); if (entity == null) { return; } + if (buildOrderService.Add(entity, economyService, toastService)) { economyService.Calculate(buildOrderService, timingService, buildOrderService.GetLastRequestInterval()); diff --git a/IGP/Pages/BuildCalculator/Parts/ChartComponent.razor b/IGP/Pages/BuildCalculator/Parts/ChartComponent.razor index 305ea18..b0068e4 100644 --- a/IGP/Pages/BuildCalculator/Parts/ChartComponent.razor +++ b/IGP/Pages/BuildCalculator/Parts/ChartComponent.razor @@ -58,9 +58,7 @@ [Inject] IBuildOrderService BuildOrderService { get; set; } = default!; - - int height = 100; - readonly int width = 250; + private readonly int width = 250; List valueList = new(); diff --git a/IGP/Pages/Comparision/ComparisionPage.razor b/IGP/Pages/Comparision/ComparisionPage.razor index 5ad0c11..ada7939 100644 --- a/IGP/Pages/Comparision/ComparisionPage.razor +++ b/IGP/Pages/Comparision/ComparisionPage.razor @@ -21,7 +21,7 @@ grid-template-areas: 'loader sand compare compare' ;">
Comparision Charts - +
@@ -90,7 +90,7 @@ grid-template-areas: 'loader sand compare compare' ;"> return; } - var entity = EntityModel.GetFrom(hotkey, hotkeyGroup, isHoldSpace, faction, immortal); + var entity = EntityModel.GetFrom(hotkey!, hotkeyGroup, isHoldSpace, faction, immortal); if (entity == null) { return; diff --git a/IGP/Pages/Documentation/Parts/DocumentComponent.razor b/IGP/Pages/Documentation/Parts/DocumentComponent.razor index 3229a66..95267a8 100644 --- a/IGP/Pages/Documentation/Parts/DocumentComponent.razor +++ b/IGP/Pages/Documentation/Parts/DocumentComponent.razor @@ -1,4 +1,7 @@ @using System.Net.Http.Json +@using Markdig.Extensions.Yaml +@using Markdig.Syntax +@using YamlDotNet.Serialization @inject HttpClient httpClient @if (content == null) @@ -9,15 +12,17 @@ else {
-
@DocContentModel.Name
- +
@docFrontMatter.Title
-
Updated: @DocContentModel.UpdatedDate.ToString("MM/dd/yyyy")
-
Created: @DocContentModel.CreatedDate.ToString("MM/dd/yyyy")
+
Updated: @docFrontMatter.UpdatedDate.ToString("MM/dd/yyyy")
+
Created: @docFrontMatter.CreatedDate.ToString("MM/dd/yyyy")
-
@((MarkupString)Markdown.ToHtml(content, pipeline))
+
@((MarkupString)Markdown.ToHtml(content, Pipeline))
+
+ + } @code { - [Parameter] - public DocContentModel DocContentModel { get; set; } = default!; + [Parameter] public DocContentModel DocContentModel { get; set; } = default!; + + DocFrontMatterModel docFrontMatter = null!; + private string? content = null; - MarkdownPipeline pipeline = new MarkdownPipelineBuilder().UseAdvancedExtensions().Build(); - string? content = null; - private async Task LoadContent() => content = await httpClient.GetStringAsync($"content/docs/{DocContentModel.Content}.md"); + private string Filepath => $"content/docs/{DocContentModel.Content}.md"; + private string GitUrl => $"{Project.GitResourcesUrl}/{Filepath}"; + private MarkdownPipeline Pipeline => MarkdownFiles.Pipeline; + + private async Task LoadContent() { + content = await MarkdownFiles.LoadMarkdown(httpClient, Filepath); + + return docFrontMatter = + await MarkdownFiles.LoadFrontMatter(httpClient, Filepath); + } + protected override async Task OnParametersSetAsync() => await LoadContent(); protected override async Task OnInitializedAsync() => await LoadContent(); } \ No newline at end of file diff --git a/IGP/Pages/Documentation/Parts/DocumentNavComponent.razor b/IGP/Pages/Documentation/Parts/DocumentNavComponent.razor index 3a69645..6db302a 100644 --- a/IGP/Pages/Documentation/Parts/DocumentNavComponent.razor +++ b/IGP/Pages/Documentation/Parts/DocumentNavComponent.razor @@ -13,7 +13,8 @@ .docNavContainer { display: flex; flex-direction: column; - } + gap: 8px; + } .docNavButton a { color: white; diff --git a/IGP/Pages/Notes/Parts/NoteComponent.razor b/IGP/Pages/Notes/Parts/NoteComponent.razor index ae27af8..1e89b62 100644 --- a/IGP/Pages/Notes/Parts/NoteComponent.razor +++ b/IGP/Pages/Notes/Parts/NoteComponent.razor @@ -8,14 +8,14 @@ else {
-
@NoteContentModel.Name
- +
@noteFrontMatter.Title
-
Updated: @NoteContentModel.UpdatedDate.ToString("MM/dd/yyyy")
-
Created: @NoteContentModel.CreatedDate.ToString("MM/dd/yyyy")
+
Updated: @noteFrontMatter.UpdatedDate.ToString("MM/dd/yyyy")
+
Created: @noteFrontMatter.CreatedDate.ToString("MM/dd/yyyy")
-
@((MarkupString)Markdown.ToHtml(content, pipeline))
+
@((MarkupString)Markdown.ToHtml(content, Pipeline))
+
} @@ -34,15 +34,31 @@ else flex-direction: column; } + + .noteFooter { + display: flex; + justify-content: flex-end; + } + @code { - [Parameter] - public NoteContentModel NoteContentModel { get; set; } = default!; + [Parameter] public NoteContentModel NoteContentModel { get; set; } = default!; + + NoteFrontMatterModel noteFrontMatter = null!; + private string? content = null; - string? content = null; - MarkdownPipeline pipeline = new MarkdownPipelineBuilder().UseAdvancedExtensions().Build(); - private async Task LoadContent() => content = await httpClient.GetStringAsync($"content/notes/{NoteContentModel.Content}.md"); + private string Filepath => $"content/notes/{NoteContentModel.Content}.md"; + private string GitUrl => $"{Project.GitResourcesUrl}/{Filepath}"; + private MarkdownPipeline Pipeline => MarkdownFiles.Pipeline; + + private async Task LoadContent() { + content = await MarkdownFiles.LoadMarkdown(httpClient, Filepath); + + return noteFrontMatter = + await MarkdownFiles.LoadFrontMatter(httpClient, Filepath); + } + protected override async Task OnParametersSetAsync() => await LoadContent(); protected override async Task OnInitializedAsync() => await LoadContent(); diff --git a/IGP/Pages/Notes/Parts/NoteNavComponent.razor b/IGP/Pages/Notes/Parts/NoteNavComponent.razor index 7244f57..1ffce15 100644 --- a/IGP/Pages/Notes/Parts/NoteNavComponent.razor +++ b/IGP/Pages/Notes/Parts/NoteNavComponent.razor @@ -11,8 +11,9 @@