Pagefind.Net.Frontend 0.3.0

dotnet add package Pagefind.Net.Frontend --version 0.3.0
                    
NuGet\Install-Package Pagefind.Net.Frontend -Version 0.3.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Pagefind.Net.Frontend" Version="0.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Pagefind.Net.Frontend" Version="0.3.0" />
                    
Directory.Packages.props
<PackageReference Include="Pagefind.Net.Frontend" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Pagefind.Net.Frontend --version 0.3.0
                    
#r "nuget: Pagefind.Net.Frontend, 0.3.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Pagefind.Net.Frontend@0.3.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Pagefind.Net.Frontend&version=0.3.0
                    
Install as a Cake Addin
#tool nuget:?package=Pagefind.Net.Frontend&version=0.3.0
                    
Install as a Cake Tool

Pagefind.Net.Frontend

Ships the Pagefind browser query runtime (pagefind.js and wasm.en.pagefind) as embedded resources. An MSBuild target automatically extracts the files into your project on build -- no npm install required.

Ships Pagefind 1.5.2 runtime.

Automatic extraction

Install the package and the frontend files appear in wwwroot/pagefind/ after every build:

dotnet add package Pagefind.Net.Frontend

The output path is configurable in your .csproj:

<PropertyGroup>
  <PagefindFrontendOutputPath>wwwroot/pagefind</PagefindFrontendOutputPath>
</PropertyGroup>

To disable automatic extraction entirely:

<PropertyGroup>
  <PagefindFrontendDisableExtract>true</PagefindFrontendDisableExtract>
</PropertyGroup>

Programmatic API

Extract the runtime files from code using PagefindFrontend.ExtractToAsync:

using Pagefind.Net.Frontend;

string[] written = await PagefindFrontend.ExtractToAsync("wwwroot/pagefind");

The method writes files only when the embedded version is newer than what is already on disk (tracked via a version marker file). Pass force: true to always overwrite.

An overload accepting IFileSystem is available for testing.

ASP.NET integration

ASP.NET does not recognize Pagefind's custom file extensions by default. Register them in your static file middleware:

using Microsoft.AspNetCore.StaticFiles;

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 });

Without these mappings, the Pagefind JS runtime will receive 404 responses when loading index data.

Documentation

Full documentation: nullean.github.io/pagefind-net

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.3.0 64 7/24/2026
0.2.0 45 7/24/2026
0.1.0 43 7/24/2026