Pagefind.Net 0.3.0

dotnet add package Pagefind.Net --version 0.3.0
                    
NuGet\Install-Package Pagefind.Net -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" 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" Version="0.3.0" />
                    
Directory.Packages.props
<PackageReference Include="Pagefind.Net" />
                    
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 --version 0.3.0
                    
#r "nuget: Pagefind.Net, 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@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&version=0.3.0
                    
Install as a Cake Addin
#tool nuget:?package=Pagefind.Net&version=0.3.0
                    
Install as a Cake Tool

Pagefind.Net

A pure .NET Pagefind indexer that generates a Pagefind-compatible search index. No native Rust binary or subprocess required -- the entire indexing pipeline runs in managed code and is AOT-compatible.

Usage

using Pagefind.Net;

var index = new PagefindIndex(new PagefindIndexOptions { Language = "en" });

index.AddRecord(new PagefindRecord
{
    Url = "/guide/",
    Title = "Getting started",
    Content = "Full plain-text body of the page...",
    WeightedSegments =
    [
        new WeightedSegment("Getting started", Weight: 7),
        new WeightedSegment("Full plain-text body of the page...", Weight: 1),
    ],
    Anchors =
    [
        new PagefindAnchor(ElementId: "setup", Text: "Setup", ByteLocation: 0),
    ],
    Meta = new Dictionary<string, string> { ["title"] = "Getting started" },
});

await index.WriteAsync("wwwroot", CancellationToken.None);

WriteAsync writes all index data files into wwwroot/pagefind/:

  • pagefind-entry.json
  • pagefind.{hash}.pf_meta
  • index/{hash}.pf_index
  • fragment/{hash}.pf_fragment

Key types

Type Description
PagefindIndex Accumulates records and writes the index via WriteAsync.
PagefindRecord A single searchable document with URL, title, content, segments, anchors, and metadata.
WeightedSegment A text segment with a search weight (body = 1, H2 = 4, H1 = 7).
PagefindAnchor A heading anchor for sub-page deep links in search results.
PagefindIndexOptions Configuration for language and tokenisation behaviour.

Frontend runtime

This package writes only the index data files. The Pagefind query runtime (pagefind.js and wasm.en.pagefind) must be provided separately. You have two options:

  • Install the Pagefind.Net.Frontend NuGet package, which ships the runtime and auto-extracts it on build.
  • Install the pagefind npm package and copy the runtime files yourself.

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 43 7/24/2026
0.1.0 43 7/24/2026