Skip to content

Commit

Permalink
change pipeline name; adds websiteKeys
Browse files Browse the repository at this point in the history
  • Loading branch information
tesar-tech committed Nov 25, 2023
1 parent ae4ac3e commit 431b855
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 25 deletions.
Expand Up @@ -40,7 +40,7 @@ jobs:
if: github.ref != 'refs/heads/master'
uses: JamesIves/github-pages-deploy-action@v4
with:
FOLDER: ${{ env.WEBAPP_PATH }}/output
folder: ${{ env.WEBAPP_PATH }}/output

- name: Deploy to netlify-deploy branch
if: github.ref == 'refs/heads/master'
Expand Down
3 changes: 1 addition & 2 deletions src/Components/Layout/MainLayout.razor
@@ -1,6 +1,5 @@
@using Microsoft.Extensions.Options
@inherits LayoutComponentBase
@inject IOptions<AppSettings> AppSettings


<div class="mx-auto max-w-3xl px-4 sm:px-6 xl:max-w-5xl xl:px-0 ">
Expand All @@ -13,7 +12,7 @@
<footer>
<div class="mt-16 flex flex-col items-center">
<div class="mb-3 flex space-x-4">
<a class="text-sm text-gray-500 transition hover:text-gray-600" target="_blank" rel="noopener noreferrer" href="@AppSettings.Value.GitHubRepo">
<a class="text-sm text-gray-500 transition hover:text-gray-600" target="_blank" rel="noopener noreferrer" href="@WebsiteKeys.GitHubRepo">
<span class="sr-only">github</span>
<Svg Icon="Svg.Icons.Github"/>
</a>
Expand Down
9 changes: 2 additions & 7 deletions src/Components/Layout/NavMenu.razor
Expand Up @@ -58,19 +58,14 @@

@code
{
[Inject] IOptions<AppSettings> AppSettings { get; set; } = null!;
List<(string name, string link)> menuItems = null!;
protected override void OnInitialized() {
base.OnInitialized();
menuItems =new()
List<(string name, string link)> menuItems =new()
{
("Home", ""),
("About", "about"),
("Tags", "tags"),
("Github",AppSettings.Value.GitHubRepo ),
("Github",WebsiteKeys.GitHubRepo ),
};

}



Expand Down
3 changes: 1 addition & 2 deletions src/Components/Pages/Blog.razor
Expand Up @@ -5,7 +5,6 @@
@using BlazorStatic
@using BlazorStatic.Services
@using System.Net
@inject IOptions<AppSettings> AppSettings
@inject BlogService<FrontMatterZodoc> BlogService
@using Zodoc.Components.Blog

Expand Down Expand Up @@ -83,7 +82,7 @@
</div>
</div>
<div class="pb-6 pt-6 text-sm text-gray-300">
<a target="_blank" rel="noopener noreferrer" href="@(AppSettings.Value.BlogPostStorageAddress + "en/" + FileName + ".md")">View on GitHub</a>
<a target="_blank" rel="noopener noreferrer" href="@(WebsiteKeys.BlogPostStorageAddress + "en/" + FileName + ".md")">View on GitHub</a>
</div>
</div>
<footer>
Expand Down
17 changes: 4 additions & 13 deletions src/Program.cs
Expand Up @@ -50,11 +50,6 @@
// Add services to the container.
builder.Services.AddRazorComponents();

builder.Services.AddOptions<AppSettings>()
.BindConfiguration(nameof(AppSettings))
.ValidateDataAnnotations()
.ValidateOnStart();

var app = builder.Build();

// Configure the HTTP request pipeline.
Expand Down Expand Up @@ -82,15 +77,11 @@
app.UseBlog<FrontMatterZodoc>();
app.UseBlazorStaticGenerator(shutdownApp: !app.Environment.IsDevelopment());



app.Run();

public class AppSettings
public static class WebsiteKeys
{
[Required]
public required string BlogPostStorageAddress { get; init; }

[Required]
public required string GitHubRepo { get; init; }
public const string BlogPostStorageAddress = "https://github.com/tesar-tech/zodoc/tree/master/src/Content/Blog/";
public const string GitHubRepo = "https://github.com/tesar-tech/zodoc/";
}

0 comments on commit 431b855

Please sign in to comment.