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" />
<PackageReference Include="Pagefind.Net" />
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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#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
#tool nuget:?package=Pagefind.Net&version=0.3.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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.jsonpagefind.{hash}.pf_metaindex/{hash}.pf_indexfragment/{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
pagefindnpm package and copy the runtime files yourself.
Documentation
Full documentation: nullean.github.io/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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- System.Formats.Cbor (>= 10.0.0)
- System.IO.Abstractions (>= 22.0.9)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.