Skip to content

Commit

Permalink
Changed stuff, added docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugos68 committed Jan 28, 2024
1 parent 911571c commit 1dc1751
Show file tree
Hide file tree
Showing 6 changed files with 3,339 additions and 2,367 deletions.
5 changes: 5 additions & 0 deletions .changeset/cool-suns-sing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"vite-plugin-pagefind": patch
---

Renamed pagefindDir to appDir and removed the need to specify the `pagefind` folder
5 changes: 5 additions & 0 deletions .changeset/wise-sheep-collect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"vite-plugin-pagefind": patch
---

Added documentation (see README.md)
18 changes: 9 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,42 @@

### Patch Changes

- bd97d3d: Finally fixed running pagefind after build
- fcf32c0: Fixed broken vite dependency: https://github.com/vitejs/vite/issues/15714
- bd97d3d: Finally fixed running pagefind after build
- fcf32c0: Fixed broken vite dependency: https://github.com/vitejs/vite/issues/15714

## 0.0.7

### Patch Changes

- 9bdcc49: Fixed pagefind post build not running after the build process
- 9bdcc49: Fixed pagefind post build not running after the build process

## 0.0.6

### Patch Changes

- d911925: Fixed hardcoded buildDir
- 324852e: Added quotes around paths for pagefind to prevent invalid paths from occuring
- d911925: Fixed hardcoded buildDir
- 324852e: Added quotes around paths for pagefind to prevent invalid paths from occuring

## 0.0.5

### Patch Changes

- 04163e9: Added cwd option that defaults to process.cwd, added default to buildDir: build
- 04163e9: Added cwd option that defaults to process.cwd, added default to buildDir: build

## 0.0.4

### Patch Changes

- 93731cd: Bugfix: Had colorette as devDep causing issues with the plugin
- 93731cd: Bugfix: Had colorette as devDep causing issues with the plugin

## 0.0.3

### Patch Changes

- 2f8a075: Only packaging dist files now
- 2f8a075: Only packaging dist files now

## 0.0.2

### Patch Changes

- a969687: Released package
- a969687: Released package
48 changes: 36 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,67 @@ A Vite plugin for easily integrating pagefind into vite projects.

## Prerequisites

- Ensure [Pagefind](https://github.com/CloudCannon/pagefind) is installed.
- Ensure [Pagefind](https://github.com/CloudCannon/pagefind) is installed.

## Installation

Install from npm using your preffered package manager:

```bash
pnpm add -D vite-plugin-pagefind
```

## Usage

Add the plugin to your vite config:

```ts
import { defineConfig } from 'vite';
import { pagefind, type PagefindConfig } from 'vite-plugin-pagefind';

const pagefindConfig: PagefindConfig = {
pagefindDir: '...',
siteDir: '...',
cwd: '...'
}
appDir: '...',
buildDir: '...',
cwd: '...'
};

export default defineConfig({
// ...
plugins: [..., pagefind(pagefindConfig)] // Make s
// Config...
plugins: [, /* Plugins.. */ pagefind(pagefindConfig)]
});
```

## Config

### appDir

Provide a directory where you want pagefind to be placed during development.

Example: `appDir: 'static'` results in: `static/pagefind/pagefind.js`

_Default_: -

### buildDir

Optionally provide a directory where you want pagefind to run after your app has been build.

Example: `buildDir: 'public'` results in: `public/pagefind/pagefind.js`

_Default_: "build"

### cwd

Optionally provide a directory where the plugin should run from.

_Default_: `process.cwd()`

## Features

### What this plugin does do

- Ensures pagefind is ran on your build output after building.
- Ensures pagefind is present during development.
- Ensures pagefind is ran on your build output after building.
- Ensures pagefind is present during development.

### What this plugin doesn't do

- Provide a way to use pagefind in your code.


- Provide a way to use pagefind in your code.
Loading

0 comments on commit 1dc1751

Please sign in to comment.