Skip to content

Commit

Permalink
[ENG-1274] Point top-level API portal domain to first doc instead of …
Browse files Browse the repository at this point in the history
…API reference page (#273)

* top level to point to /docs

* if no doc config then point to /reference
  • Loading branch information
dphuang2 authored Oct 11, 2023
1 parent c934717 commit 4ebe732
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion generator/konfig-next-app/src/pages/[org]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const getStaticPaths: GetStaticPaths = async () => {
export const getStaticProps: GetStaticProps = async (ctx) => {
return {
redirect: {
destination: `/reference`,
destination: `/docs`,
permanent: false,
},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,14 @@ export async function generatePropsForMarkdownPage({
})

const documentationConfig = konfigYaml?.content.portal?.documentation
if (documentationConfig === undefined)
throw Error("Couldn't find documentation configuration")
if (documentationConfig === undefined) {
return {
redirect: {
destination: '/reference',
permanent: false,
},
}
}

// if no document is specified, redirect to first document
if (docUrlParam === undefined) {
Expand Down

0 comments on commit 4ebe732

Please sign in to comment.