Pagefind.Net.Frontend
0.6.0
dotnet add package Pagefind.Net.Frontend --version 0.6.0
NuGet\Install-Package Pagefind.Net.Frontend -Version 0.6.0
<PackageReference Include="Pagefind.Net.Frontend" Version="0.6.0" />
<PackageVersion Include="Pagefind.Net.Frontend" Version="0.6.0" />
<PackageReference Include="Pagefind.Net.Frontend" />
paket add Pagefind.Net.Frontend --version 0.6.0
#r "nuget: Pagefind.Net.Frontend, 0.6.0"
#:package Pagefind.Net.Frontend@0.6.0
#addin nuget:?package=Pagefind.Net.Frontend&version=0.6.0
#tool nuget:?package=Pagefind.Net.Frontend&version=0.6.0
Pagefind.Net.Frontend

Ships the Pagefind 1.5.2 browser query runtime (pagefind.js and wasm.en.pagefind) for indexes written by Pagefind.Net. An MSBuild target extracts the files into your project on build: no npm install required.
Install
dotnet add package Pagefind.Net.Frontend
Quick start
Install the package and the frontend files appear in wwwroot/pagefind/ after every build. The output path is
configurable in your .csproj, and extraction can be turned off:
<PropertyGroup>
<PagefindFrontendOutputPath>wwwroot/pagefind</PagefindFrontendOutputPath>
</PropertyGroup>
Or extract from code:
using Pagefind.Net.Frontend;
// Writes pagefind.js and wasm.en.pagefind, unless the same version is already there (force: true overwrites).
string[] written = await PagefindFrontend.ExtractToAsync("wwwroot/pagefind");
An overload accepting IFileSystem is available for testing.
ASP.NET
ASP.NET does not recognise Pagefind's file extensions. Register them in your static file middleware, or the Pagefind runtime gets 404 responses when loading index data:
using Microsoft.AspNetCore.StaticFiles;
var app = WebApplication.CreateBuilder(args).Build();
var contentTypeProvider = new FileExtensionContentTypeProvider();
contentTypeProvider.Mappings[".pf_meta"] = "application/octet-stream";
contentTypeProvider.Mappings[".pf_index"] = "application/octet-stream";
contentTypeProvider.Mappings[".pf_fragment"] = "application/octet-stream";
contentTypeProvider.Mappings[".pagefind"] = "application/wasm";
app.UseStaticFiles(new StaticFileOptions { ContentTypeProvider = contentTypeProvider });
app.Run();
More: https://pagefind.nullean.net/getting-started/asp-net/ and https://pagefind.nullean.net/reference/frontend/
Learn more
- Documentation: https://pagefind.nullean.net
- Source and issues: https://github.com/nullean/pagefind-net
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- System.IO.Abstractions (>= 23.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.