Skip to content

Commit

Permalink
..
Browse files Browse the repository at this point in the history
  • Loading branch information
pawchen committed Jul 29, 2024
1 parent 296eb67 commit a86969b
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 17 deletions.
4 changes: 3 additions & 1 deletion src/generator/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,9 @@ private static IEnumerable<XElement> GetPagesXml(string file)
=> XElement.Load(file).Descendants("page");

private static (string title, string file, string url) GetPageInfo(XElement? page)
=> page is null ? ("Index", "index.html", "") : (page.Attribute("title")!.Value, page.Attribute("file")!.Value, page.Attribute("url")!.Value);
=> page is null || page.Name != "page"
? ("Index", "index.html", "")
: (page.Attribute("title")!.Value, page.Attribute("file")!.Value, page.Attribute("url")!.Value);

private static void CopyDirectory(string source, string destination, bool recursive = true, bool overwrite = true)
{
Expand Down
8 changes: 4 additions & 4 deletions src/templates/Partials/de/DocHeader.cshtml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
@model DocumentPageModel

<div class="col-sm-3">
<a class="btn btn-default" href="@Model.RootUrlPrefix/en/" title="Return home"><span class="glyphicon glyphicon-home"></span></a>
<a class="btn btn-default" href="@Model.RootUrlPrefix/en/@Model.BookUrlName" title="Return to book"><span class="glyphicon glyphicon-book"></span></a>
<a class="btn btn-default" href="@Model.RootUrlPrefix/@Model.Language/" title="Return home"><span class="glyphicon glyphicon-home"></span></a>

@if (Model.Parent is not null)
@if (Model.Page.url != Model.BookUrlName)
{
<a class="btn btn-default" href="@Model.RootUrlPrefix/en/@Model.Parent.Value.url" title="Navigate to parent"><span class="glyphicon glyphicon-arrow-up"></span></a>
<a class="btn btn-default" href="@Model.RootUrlPrefix/@Model.Language/@Model.BookUrlName" title="Return to book"><span class="glyphicon glyphicon-book"></span></a>
<a class="btn btn-default" href="@Model.RootUrlPrefix/@Model.Language/@Model.Parent?.url" title="Navigate to parent"><span class="glyphicon glyphicon-arrow-up"></span></a>
}
</div>
<div class="col-sm-9">
Expand Down
10 changes: 6 additions & 4 deletions src/templates/Partials/en/DocHeader.cshtml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
@model DocumentPageModel

<div class="col-sm-3">
<a class="btn btn-default" href="@Model.RootUrlPrefix/en/" title="Return home"><span class="glyphicon glyphicon-home"></span></a>
<a class="btn btn-default" href="@Model.RootUrlPrefix/en/@Model.BookUrlName" title="Return to book"><span class="glyphicon glyphicon-book"></span></a>
<a class="btn btn-default" href="@Model.RootUrlPrefix/@Model.Language/" title="Return home"><span class="glyphicon glyphicon-home"></span></a>

@if (Model.Parent is not null)
@if (Model.Page.url != Model.BookUrlName)
{
<a class="btn btn-default" href="@Model.RootUrlPrefix/en/@Model.Parent.Value.url" title="Navigate to parent"><span class="glyphicon glyphicon-arrow-up"></span></a>
<a class="btn btn-default" href="@Model.RootUrlPrefix/@Model.Language/@Model.BookUrlName" title="Return to book"><span class="glyphicon glyphicon-book"></span></a>
<a class="btn btn-default" href="@Model.RootUrlPrefix/@Model.Language/@Model.Parent?.url" title="Navigate to parent"><span class="glyphicon glyphicon-arrow-up"></span></a>
}
</div>
<div class="col-sm-9">
Expand Down
10 changes: 6 additions & 4 deletions src/templates/Partials/ja/DocHeader.cshtml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
@model DocumentPageModel

<div class="col-sm-3">
<a class="btn btn-default" href="@Model.RootUrlPrefix/en/" title="Return home"><span class="glyphicon glyphicon-home"></span></a>
<a class="btn btn-default" href="@Model.RootUrlPrefix/en/@Model.BookUrlName" title="Return to book"><span class="glyphicon glyphicon-book"></span></a>
<a class="btn btn-default" href="@Model.RootUrlPrefix/@Model.Language/" title="Return home"><span class="glyphicon glyphicon-home"></span></a>

@if (Model.Parent is not null)
@if (Model.Page.url != Model.BookUrlName)
{
<a class="btn btn-default" href="@Model.RootUrlPrefix/en/@Model.Parent.Value.url" title="Navigate to parent"><span class="glyphicon glyphicon-arrow-up"></span></a>
<a class="btn btn-default" href="@Model.RootUrlPrefix/@Model.Language/@Model.BookUrlName" title="Return to book"><span class="glyphicon glyphicon-book"></span></a>
<a class="btn btn-default" href="@Model.RootUrlPrefix/@Model.Language/@Model.Parent?.url" title="Navigate to parent"><span class="glyphicon glyphicon-arrow-up"></span></a>
}
</div>
<div class="col-sm-9">
Expand Down
10 changes: 6 additions & 4 deletions src/templates/Partials/zh/DocHeader.cshtml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
@model DocumentPageModel

<div class="col-sm-3">
<a class="btn btn-default" href="@Model.RootUrlPrefix/en/" title="Return home"><span class="glyphicon glyphicon-home"></span></a>
<a class="btn btn-default" href="@Model.RootUrlPrefix/en/@Model.BookUrlName" title="Return to book"><span class="glyphicon glyphicon-book"></span></a>
<a class="btn btn-default" href="@Model.RootUrlPrefix/@Model.Language/" title="Return home"><span class="glyphicon glyphicon-home"></span></a>

@if (Model.Parent is not null)
@if (Model.Page.url != Model.BookUrlName)
{
<a class="btn btn-default" href="@Model.RootUrlPrefix/en/@Model.Parent.Value.url" title="Navigate to parent"><span class="glyphicon glyphicon-arrow-up"></span></a>
<a class="btn btn-default" href="@Model.RootUrlPrefix/@Model.Language/@Model.BookUrlName" title="Return to book"><span class="glyphicon glyphicon-book"></span></a>
<a class="btn btn-default" href="@Model.RootUrlPrefix/@Model.Language/@Model.Parent?.url" title="Navigate to parent"><span class="glyphicon glyphicon-arrow-up"></span></a>
}
</div>
<div class="col-sm-9">
Expand Down

0 comments on commit a86969b

Please sign in to comment.