File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -128,6 +128,7 @@ const mobileLinks = computed<NavigationConfigWithGroups>(() => [
128128const showFullSearch = shallowRef (false )
129129const showMobileMenu = shallowRef (false )
130130const { env } = useAppConfig ().buildInfo
131+ const prId = env === ' preview' ? useRuntimeConfig ().public .pullRequestID : 123
131132
132133// On mobile, clicking logo+search button expands search
133134const route = useRoute ()
@@ -227,6 +228,14 @@ onKeyStroke(
227228 {{ env === 'release' ? 'alpha' : env }}
228229 </span >
229230 </NuxtLink >
231+ <NuxtLink v-if =" prId" :to =" `https://github.com/npmx-dev/npmx.dev/pull/${prId}`" >
232+ <span
233+ aria-hidden =" true"
234+ class =" text-xs px-1.5 py-0.5 rounded badge-green font-sans font-medium ms-2"
235+ >
236+ PR #{{ prId }}
237+ </span >
238+ </NuxtLink >
230239 </div >
231240 <!-- Spacer when logo is hidden on desktop -->
232241 <span v-else class =" hidden sm:block w-1" />
Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ export default defineNuxtConfig({
5252 apiKey : 'f54e21fa3a2a0160595bb058179bfb1e' ,
5353 indexName : 'npm-search' ,
5454 } ,
55+ pullRequestID : process . env . VERCEL_GIT_PULL_REQUEST_ID || undefined ,
5556 } ,
5657 } ,
5758
You can’t perform that action at this time.
0 commit comments