Skip to content

Commit e8b0a70

Browse files
committed
feat: Add 'with/mdx-docs-nextra' to list of plugins
1 parent 91605d0 commit e8b0a70

File tree

5 files changed

+41
-15
lines changed

5 files changed

+41
-15
lines changed

apps/docs/docs.theme.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { useRouter } from 'next/router'
12

23
/* --- Styles ---------------------------------------------------------------------------------- */
34

@@ -19,6 +20,7 @@ export default {
1920
logo: <span><strong>FullProduct.dev</strong> ⚡️ Universal Base Starter</span>,
2021
project: {
2122
link: 'https://github.com/Aetherspace/universal-app-router',
23+
title: 'Universal Base Starter - FullProduct.dev',
2224
},
2325
footer: {
2426
text: <span>Need a <strong>Full-Product</strong> / Universal App Setup? 🚀 Check out <a href="https://codinsonn.dev" target="_blank" style={{ ...styles.tagLink, fontWeight: 'bold' }}>FullProduct.dev</a> by <a href="https://codinsonn.dev" target="_blank" style={styles.tagLink}>Thorr ⚡️ codinsonn</a></span>
@@ -29,4 +31,19 @@ export default {
2931
defaultMenuCollapseLevel: 2,
3032
toggleButton: true,
3133
},
34+
useNextSeoProps() {
35+
const { asPath } = useRouter()
36+
if (asPath === '/') {
37+
return {
38+
title: 'FullProduct.dev ⚡️ Universal Base Starter',
39+
}
40+
} else if (asPath.includes('plugins')) {
41+
return {
42+
titleTemplate: 'FullProduct.dev ⚡️ %s Plugin - Universal Base Starter Docs',
43+
}
44+
}
45+
return {
46+
titleTemplate: 'FullProduct.dev | %s - Universal Base Starter Docs',
47+
}
48+
}
3249
}

apps/docs/pages/plugins/[[...pluginBranchSlug]].mdx

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@ export async function getStaticProps({ params }) {
99
const branchName = branchNamePath?.replace(/\.mdx?/, '')?.replace?.('plugins/', '')
1010
let pageMarkdown = '# 404 | Plugin Not Found\n\nThe page may not exist, or a remote MDX rate limit may have triggered'
1111
try {
12-
if (branchName) {
13-
const githubApiBranchPRsUrl = `https://api.github.com/repos/Aetherspace/universal-app-router/pulls?head=Aetherspace:with/${branchName}`
14-
const response = await fetch(githubApiBranchPRsUrl)
15-
const branchPRs = await response.json()
16-
const branchPR = branchPRs[0]
17-
const branchPRMarkdown = branchPR.body
18-
const branchPRTitle = branchPR.title
19-
pageMarkdown = branchPRMarkdown.split('\n').reduce((acc, line) => {
20-
let newLine = line
21-
if (line.includes('<img ') && line.includes('">')) newLine = newLine.replace('">', '" />')
22-
return acc + newLine + '\n'
23-
}, `# \`${branchPRTitle}\`\n\n`)
24-
}
12+
if (branchName) {
13+
const githubApiBranchPRsUrl = `https://api.github.com/repos/Aetherspace/universal-app-router/pulls?head=Aetherspace:with/${branchName}`
14+
const response = await fetch(githubApiBranchPRsUrl)
15+
const branchPRs = await response.json()
16+
const branchPR = branchPRs[0]
17+
const branchPRMarkdown = branchPR.body
18+
const branchPRTitle = branchPR.title?.replace?.('plugin: ', '')
19+
pageMarkdown = branchPRMarkdown.split('\n').reduce((acc, line) => {
20+
let newLine = line
21+
if (line.includes('<img ') && line.includes('">')) newLine = newLine.replace('">', '" />')
22+
return acc + newLine + '\n'
23+
}, `# ${branchPRTitle} \n\n \`\`\`zsch\ngit merge with/${branchName}\n\`\`\`\n\n`)
24+
}
2525
} catch (error) {
2626
if (!error) console.error(error)
2727
}
@@ -31,8 +31,7 @@ export async function getStaticProps({ params }) {
3131
props: {
3232
...dynamicMeta,
3333
...dynamicMDX,
34-
},
35-
revalidate: false,
34+
}
3635
}
3736
}
3837

apps/docs/pages/plugins/_meta.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,9 @@
1818
"react-query": {
1919
"title": "@tanstack/react-query",
2020
"route": "/plugins/react-query"
21+
},
22+
"mdx-docs-nextra": {
23+
"title": "MDX Docs (Nextra)",
24+
"route": "/plugins/mdx-docs-nextra"
2125
}
2226
}

apps/docs/remote/pluginsConfig.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ module.exports = {
66
'mdx',
77
'graphql-server-apollo',
88
'react-query',
9+
'mdx-docs-nextra'
910
],
1011
nestedMetaData: {
1112
"nativewind": {
@@ -27,6 +28,10 @@ module.exports = {
2728
"react-query": {
2829
"title": "@tanstack/react-query",
2930
"route": "/plugins/react-query"
31+
},
32+
"mdx-docs-nextra": {
33+
"title": "MDX Docs (Nextra)",
34+
"route": "/plugins/mdx-docs-nextra"
3035
}
3136
}
3237
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"ios": "npm -w @app/expo run ios",
2727
"expo:web": "npm -w @app/expo run web",
2828
"build": "npm -w @app/next run build",
29+
"build:docs": "npm -w @app/docs run build",
2930
"add-dependencies": "npm -w @app/expo run add-dependencies",
3031
"env:local": "npm -w @app/next run env:local & npm -w @app/expo run env:local",
3132
"postinstall": "npx patch-package"

0 commit comments

Comments
 (0)