From 709eeb31e39dab5bb2e4c00e98a9a3c1598ba10f Mon Sep 17 00:00:00 2001 From: Yugo Ogura Date: Sat, 25 Jul 2020 19:32:39 +0900 Subject: [PATCH] feat: set Prev/Next to page data --- src/node/server.ts | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/src/node/server.ts b/src/node/server.ts index 4eea0adb..bdaaa5ed 100644 --- a/src/node/server.ts +++ b/src/node/server.ts @@ -104,13 +104,17 @@ function createVitePressPlugin({ ctx.body = vueSrc debug(ctx.url, ctx.status) + const pageDataWithLinks = { + ...pageData, + ...getNextAndPrev(siteData.themeConfig.sidebar, ctx.path) + } await next() // make sure this is the main