From 30857c618136b1d022894bc1c34178397a0fa547 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Wed, 5 Aug 2020 09:41:29 +0300 Subject: [PATCH] Update Index.cshtml.cs --- .../Pages/Documents/Project/Index.cshtml.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs index dd8ba6bc9c..b10d741fb2 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs @@ -309,7 +309,14 @@ namespace Volo.Docs.Pages.Documents.Project if (Project.ExtraProperties.ContainsKey("GithubVersionProviderSource") && (GithubVersionProviderSource) (long) Project.ExtraProperties["GithubVersionProviderSource"] == GithubVersionProviderSource.Branches) { - var latest = versions.FirstOrDefault(v=> v.Version == Project.LatestVersionBranchName); + var prefix = Project.ExtraProperties["VersionBranchPrefix"].ToString(); + var LatestVersionBranchNameWithoutPrefix = + !string.IsNullOrWhiteSpace(Project.LatestVersionBranchName) && + Project.LatestVersionBranchName.StartsWith(prefix) && Project.LatestVersionBranchName.Length > prefix.Length + ? Project.LatestVersionBranchName.Substring(prefix.Length) + : Project.LatestVersionBranchName; + + var latest = versions.FirstOrDefault(v=> v.Version == LatestVersionBranchNameWithoutPrefix); if (latest != null) {