Skip to content

Commit 5396966

Browse files
committed
docs(astro-fuse): update README more clearer
1 parent 42b6959 commit 5396966

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

packages/astro-fuse/README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ In 'output' mode, all HTML files generated as a result of the build are subject
129129

130130
```js
131131
// astro.config.mjs
132-
fuse({
132+
fuse(['content', 'frontmatter.title'], {
133133
filter: (path) => /^\/post\/[^/]+\/$/.test(path),
134134
})
135135
```
@@ -140,7 +140,7 @@ In 'source' mode, all markdown files in the `/src/content` folder are subject to
140140

141141
```js
142142
// astro.config.mjs
143-
fuse({
143+
fuse(['content', 'frontmatter.title'], {
144144
filter: (path) => path.startsWith('/src/content/post/'),
145145
})
146146
```
@@ -152,10 +152,13 @@ Setting the `basedOn` option to `'output'` will now generate the index file base
152152
```js
153153
// astro.config.mjs
154154
// ...
155-
fuse({
156-
extractContentFromHTML: 'article' // index text inner <article> element.
157-
extractContentFromHTML: $ => $('div#content') // or. you can use cheerio instance.
158-
})
155+
fuse(
156+
['content', 'frontmatter.title'],
157+
{
158+
extractContentFromHTML: 'article' // index text inner <article> element.
159+
extractContentFromHTML: $ => $('div#content') // or. you can use cheerio instance.
160+
}
161+
)
159162
```
160163

161164
#### extractFrontmatterFromHTML (only for `output` mode)
@@ -175,8 +178,7 @@ In this situation, the `extractFrontmatterFromHTML` option can be helpful. If yo
175178
```js
176179
// astro.config.mjs
177180

178-
fuse({
179-
keys: ['content', 'frontmatter.title'],
181+
fuse(['content', 'frontmatter.title'], {
180182
extractFrontmatterFromHTML: ($) => {
181183
// read that element value. $ is cheerio instance.
182184
const el = $('[data-frontmatter]')

0 commit comments

Comments
 (0)