We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 494b993 commit 037addcCopy full SHA for 037addc
site/pages/docs/[version]/[[...slug]].jsx
@@ -130,6 +130,10 @@ DocsPage.propTypes = {
130
131
export async function getStaticProps({ params }) {
132
const slug = params.slug?.[0] ?? '';
133
+ if(params.version === 'latest') {
134
+ params.version = apiVersions[0].value;
135
+ }
136
+
137
const isValidVersion = apiVersions.find(ver => ver.value === params.version);
138
139
if(!isValidVersion) {
@@ -172,7 +176,7 @@ export async function getStaticProps({ params }) {
172
176
}
173
177
174
178
export async function getStaticPaths() {
175
- const paths = [];
179
+ const paths = [{ params: { version: 'latest', slug: [] } }];
180
181
for(const ver of apiVersions) {
182
// eslint-disable-next-line no-await-in-loop
0 commit comments