Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Lunr Search Resource Paths #1000

Merged
merged 3 commits into from
Oct 28, 2022
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: 3 additions & 1 deletion src/Statiq.Web/Pipelines/SearchIndex.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ public SearchIndex()

// Create the module
GenerateLunrIndex generateLunrIndex = new GenerateLunrIndex()
.WithIndexPath(ctx.GetPath(WebKeys.SearchScriptPath))
.WithScriptPath(ctx.GetPath(WebKeys.SearchScriptPath, NormalizedPath.Null))
.WithIndexPath(ctx.GetPath(WebKeys.SearchIndexPath, NormalizedPath.Null))
.WithResultsPath(ctx.GetPath(WebKeys.SearchResultsPath, NormalizedPath.Null))
.ZipIndexFile(ctx.GetBool(WebKeys.ZipSearchIndexFile, true))
.ZipResultsFile(ctx.GetBool(WebKeys.ZipSearchResultsFile, true))
.IncludeHostInLinks(ctx.GetBool(WebKeys.SearchIncludeHost))
Expand Down
12 changes: 11 additions & 1 deletion src/Statiq.Web/WebKeys.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ public static class WebKeys
/// </summary>
public const string SearchScriptPath = nameof(SearchScriptPath);

/// <summary>
/// The destination path of the search index file ("search.index.json" or "search.index.json.gz" by default).
/// </summary>
public const string SearchIndexPath = nameof(SearchIndexPath);

/// <summary>
/// The destination path of the search results file ("search.results.json" or "search.results.json.gz" by default).
/// </summary>
public const string SearchResultsPath = nameof(SearchResultsPath);

/// <summary>
/// Indicates whether the search index file should be gzipped (the default is <c>true</c>).
/// If this is <c>true</c>, the JavaScript library pako must be included on the client to decompress the file.
Expand Down Expand Up @@ -567,4 +577,4 @@ public static class WebKeys

public const string AzureAppServicePassword = nameof(AzureAppServicePassword);
}
}
}