File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -365,11 +365,18 @@ export class NextDrupalPages extends NextDrupal {
365365 }
366366
367367 /**
368- * Gets the path from the context.
368+ * Return the path (slug) from getStaticProps or getServerSideProps context.
369369 *
370- * @param {GetStaticPropsContext } context The static props context .
370+ * @param {GetStaticPropsContext } context The context from `getStaticProps` or `getServerSideProps` .
371371 * @param {Object } options Options for the request.
372372 * @returns {string } The constructed path.
373+ * @example
374+ * Get the path (slug) from `getStaticProps` context
375+ * ```ts
376+ * export async function getStaticProps(context) {
377+ * const slug = await drupal.getPathFromContext(context)
378+ * }
379+ * ```
373380 */
374381 getPathFromContext (
375382 context : GetStaticPropsContext ,
You can’t perform that action at this time.
0 commit comments