Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions modules/docs/app/VoloDocs.Web/VoloDocsWebModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ public override void ConfigureServices(ServiceConfigurationContext context)

Configure<DocsProjectPdfGeneratorOptions>(options =>
{
options.BaseUrl = configuration["App:selfUrl"];
options.IndexPagePath = "Index.md";
options.BaseUrl = configuration["App:SelfUrl"];
options.IndexPagePath = "index.md";
options.CalculatePdfFileTitle = project => project.ShortName == "abp" ? "ABP Documentation" : null;
options.DocumentContentNormalizer = content => content.Replace("<i class=\"fa fa-minus text-secondary\"></i>", "No").Replace("<i class=\"fa fa-check text-success\"></i>", "Yes");
});
Expand Down
2 changes: 1 addition & 1 deletion modules/docs/app/VoloDocs.Web/appsettings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"App": {
"selfUrl": "https://localhost:5001"
"SelfUrl": "https://localhost:5001"
},
"Kestrel": {
"EndPoints": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,19 +326,21 @@ private async Task<Document> GetDocumentAsync(
version = string.IsNullOrWhiteSpace(version) ? project.LatestVersionBranchName : version;

Document document = null;

Exception firstException = null;
foreach (var name in GetPossibleNames(documentName, project.Format))

var possibleNames = GetPossibleNames(documentName, project.Format);
document = await DocumentRepository.FindAsync(project.Id, possibleNames, languageCode, version);
if (document != null)
{
return document;
}

foreach (var name in possibleNames)
{
try
{
document = await DocumentRepository.FindAsync(project.Id, documentName, version, languageCode);
if (document != null)
{
break;
}

document = await DocumentSource.GetDocumentAsync(project, name, languageCode, version);
await DocumentRepository.InsertAsync(document, true);
break;
}
catch (Exception ex)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@
@if (Model.HasDownloadPdfPermission)
{
<div class="docs-sidebar-footer">
<a href="@Url.Content($"~/api/docs/documents/pdf?ProjectId={Model.Project.Id}&Version={(Model.LatestVersionInfo == null || Model.LatestVersionInfo.IsSelected ? DocsAppConsts.Latest : Model.Version)}&LanguageCode={Model.LanguageCode}")" target="_blank" class="download-pdf-btn">
<a href="@Url.Content($"~/api/docs/documents/pdf?ProjectId={Model.Project.Id}&Version={(Model.LatestVersionInfo.IsSelected ? Model.LatestVersionInfo.Version : Model.Version)}&LanguageCode={Model.LanguageCode ?? Model.DefaultLanguageCode}")" target="_blank" class="download-pdf-btn">
<i class="fa fa-download"></i> @L["DownloadPDF"]
</a>
</div>
Expand Down
Loading