Skip to content

Commit 30205ba

Browse files
committed
docs(core): update example of extendsPageOptions hook
1 parent f24c904 commit 30205ba

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/reference/plugin-api.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ Set permalink pattern for pages in `_posts` directory:
155155

156156
```js
157157
module.exports = {
158-
extendsPageOptions: ({ filePath }) => {
159-
if (filePath?.startsWith('_posts/')) {
158+
extendsPageOptions: ({ filePath }, app) => {
159+
if (filePath?.startsWith(app.dir.source('_posts/'))) {
160160
return {
161161
frontmatter: {
162162
permalinkPattern: '/:year/:month/:day/:slug.html',

docs/zh/reference/plugin-api.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ module.exports = {
156156

157157
```js
158158
module.exports = {
159-
extendsPageOptions: ({ filePath }) => {
160-
if (filePath?.startsWith('_posts/')) {
159+
extendsPageOptions: ({ filePath }, app) => {
160+
if (filePath?.startsWith(app.dir.source('_posts/'))) {
161161
return {
162162
frontmatter: {
163163
permalinkPattern: '/:year/:month/:day/:slug.html',

0 commit comments

Comments
 (0)