Skip to content

Commit

Permalink
Merge pull request bradygaster#7 from bradygaster/dotnetmicroservices…
Browse files Browse the repository at this point in the history
…workshop

added configurability for header visibility
  • Loading branch information
bradygaster authored May 26, 2020
2 parents bca3bd4 + 2ef509f commit b9b4131
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Client/Shared/Header.razor
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
@inject DownrOptions options
@inject IJSRuntime JSRuntime

<header class="blog-header py-3">
@if(options.ShowTopMostTitleBar)
{
<header class="blog-header py-3">
<div class="row flex-nowrap justify-content-between align-items-center">
<div class="col-4 pt-1">
<a class="text-muted" href="/feed/rss" target="_blank">Subscribe</a>
Expand All @@ -14,19 +16,23 @@
<a class="blog-header-logo text-dark" href="#">@options.Title</a>
</div>
<div class="col-4 d-flex justify-content-end align-items-center">

</div>
</div>
</header>
}

@if(options.ShowCategoryMenu)
{
<div class="nav-scroller py-1 mb-2">
<nav class="nav d-flex justify-content-between">
@foreach (var category in Categories)
{
<NavLink class="p-2 text-muted" href="@($"/category/{category}")">@category</NavLink>
}
<NavLink class="p-2 text-muted float-right" href="/">home</NavLink>
</nav>
</div>
}

@if(Post == null)
{
Expand Down
12 changes: 12 additions & 0 deletions Shared/Config/DownrOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,18 @@ public class DownrOptions
/// </summary>
/// <value></value>
public string HeaderImage { get; set; }

/// <summary>
/// When set to false, the topmost bar in the UI is hidden. Default is true.
/// </summary>
/// <value></value>
public bool ShowTopMostTitleBar { get; set; } = true;

/// <summary>
/// When set to false, the category bar is hidden. Default is true.
/// </summary>
/// <value></value>
public bool ShowCategoryMenu { get; set; } = true;
}

public enum SiteMode : int
Expand Down

0 comments on commit b9b4131

Please sign in to comment.