Skip to content
프로젝트

소개

Pagefind 정적 사이트 검색을 Astro에 통합합니다.

웹 및 앱 개발

이 수치를 측정하는 방법

What you can do

  • Build pagefind index upon static build
  • Serve previously prebuilt search index in astro dev mode
  • Simple Search Astro component based on Pagefind Searchbox
  • Supports customized base URL path

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

Astro-Pagefind

CI npm

Astro integration for Pagefind static site search.

Features

  • Build pagefind index upon static build
  • Serve previously prebuilt search index in astro dev mode
  • Simple Search Astro component based on Pagefind Searchbox
  • Supports customized base URL path
  • Supports multiple instances of the component on a page
  • Supports Astro view transitions
  • Allows passing index config to pagefind

Usage

Install:

npm i astro-pagefind

Add integration to the Astro config:

//astro.config.ts

import { defineConfig } from "astro/config";
import pagefind from "astro-pagefind";

export default defineConfig({
  integrations: [pagefind()],
});

Add search component on a page:

---
import Search from "astro-pagefind/components/Search.astro";
---

<Search instance="search" className="pagefind-ui" searchboxOptions={{ placeholder: "search" }} />

See Main.layout for a usage example.

Pagefind 1.5.0

Pagefind has introduced component-based UI in version 1.5.0. It is now much easier to integrate Pagefind UI into Astro projects. New users are encouraged to integrate Pagefind UI component directly instead of using the astro-pagefind/components/Search.astro component. This component is now in maintenance mode and will not receive any new UI-related features anymore. You have to import astro-pagefind/components/PagefindConfig.astro component to get the Pagefind bundle path wired correctly.

Here is how to get the searchbox UI on a page:

---
import PagefindConfig from "astro-pagefind/components/PagefindConfig.astro";
---

<PagefindConfig />
<pagefind-searchbox></pagefind-searchbox>

See Main.layout for a more detailed example.

For more details and information on Pagefind UI please consult Pagefind docs directly.

관련 프로젝트 살펴보기

불러오는 중…