Skip to content

Commit

Permalink
force order of docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mythz committed Jul 2, 2023
1 parent 16861c9 commit 5ff3173
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions MyApp/Markdown.Pages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ public class MarkdownPages : MarkdownPagesBase<MarkdownFileInfo>
public MarkdownPages(ILogger<MarkdownPages> log, IWebHostEnvironment env) : base(log,env) {}
List<MarkdownFileInfo> Pages { get; set; } = new();
public List<MarkdownFileInfo> GetVisiblePages(string? prefix=null, bool allDirectories=false) => prefix == null
? Pages.Where(x => IsVisible(x) && !x.Slug!.Contains('/')).OrderBy(x => x.Order).ToList()
? Pages.Where(x => IsVisible(x) && !x.Slug!.Contains('/')).OrderBy(x => x.Order).ThenBy(x => x.Path).ToList()
: Pages.Where(x => IsVisible(x) && x.Slug!.StartsWith(prefix.WithTrailingSlash()))
.Where(x => allDirectories || (x.Slug.CountOccurrencesOf('/') == prefix.CountOccurrencesOf('/') + 1))
.OrderBy(x => x.Order).ToList();
.OrderBy(x => x.Order).ThenBy(x => x.Path).ToList();

public MarkdownFileInfo? GetBySlug(string slug)
{
Expand Down
2 changes: 1 addition & 1 deletion MyApp/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"AllowedHosts": "*",
"AppConfig": {
"LocalBaseUrl": "https://localhost:5002",
"PublicBaseUrl": "https://razor-ssg.web-templates.io"
"PublicBaseUrl": "https://docs2.servicestack.net"
}
}

0 comments on commit 5ff3173

Please sign in to comment.