From 7ca7c5da64db6f0b071925d3777b3a474f9ac3a4 Mon Sep 17 00:00:00 2001 From: Gaurav Sharma Date: Wed, 14 Dec 2022 13:13:41 +0530 Subject: [PATCH] Adding examples on `pages-api` Exampled added to `removePageByPath` and `removePagesByComponent` --- docs/pages-api.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/pages-api.md b/docs/pages-api.md index e9ee66d37..5139030b3 100644 --- a/docs/pages-api.md +++ b/docs/pages-api.md @@ -68,10 +68,26 @@ Removes a page created by `createPage`. ### removePageByPath(path) Removes a page matching the provided path. +```js +//gridsome.server.js +module.exports = function (api) { + api.createManagedPages(({ removePageByPath }) => { + removePageByPath('/my-page') + }) +} +``` ### removePagesByComponent(path) Removes all pages matching the provided component path. +```js +//gridsome.server.js +module.exports = function (api) { + api.createManagedPages(({ removePagesByComponent }) => { + removePagesByComponent('./src/pages/MyPage.vue') + }) +} +``` ### findAndRemovePages(query)