Browse Source

fix: Navigation Bug

pull/23037/head
SALİH ÖZKARA 10 months ago
parent
commit
ee07f0c8e4
  1. 2
      modules/docs/src/Volo.Docs.Web/Pages/Documents/Index.cshtml
  2. 19
      modules/docs/src/Volo.Docs.Web/Pages/Documents/Index.cshtml.cs

2
modules/docs/src/Volo.Docs.Web/Pages/Documents/Index.cshtml

@ -31,7 +31,7 @@
{
<li>
<h3>
<a href="@(Model.DocumentsUrlPrefix + project.ShortName)">
<a href="@Model.GetUrlForProject(project)">
@project.Name
</a>
</h3>

19
modules/docs/src/Volo.Docs.Web/Pages/Documents/Index.cshtml.cs

@ -43,5 +43,24 @@ namespace Volo.Docs.Pages.Documents
return Page();
}
public string GetUrlForProject(ProjectDto project = null, string language = "en", string version = null)
{
var routeValues = new Dictionary<string, object> {
{ nameof(Project.IndexModel.Version), version ?? DocsAppConsts.Latest }
};
if (!_uiOptions.SingleProjectMode.Enable)
{
routeValues.Add(nameof(Project.IndexModel.ProjectName), project?.ShortName);
}
if(_uiOptions.MultiLanguageMode)
{
routeValues.Add(nameof(Project.IndexModel.LanguageCode), language);
}
return Url.Page("/Documents/Project/Index", routeValues);
}
}
}

Loading…
Cancel
Save