Skip to content

Commit

Permalink
add getStaticPaths and Props
Browse files Browse the repository at this point in the history
Signed-off-by: Ansh Goyal <[email protected]>
  • Loading branch information
anshgoyalevil committed Aug 20, 2023
1 parent b62c200 commit 7a07766
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion pages/[lang]/tools/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ import Heading from '../../../components/typography/Heading';
import Paragraph from '../../../components/typography/Paragraph';
import DocsButton from '../../../components/buttons/DocsButton';
import Button from '../../../components/buttons/Button';
import { useTranslation } from '../../../lib/i18n';
import {
getAllLanguageSlugs,
getLanguage, useTranslation
} from '../../../lib/i18n';

const features = [
{
Expand Down Expand Up @@ -220,3 +223,20 @@ export default function CliPage() {
</GenericLayout>
);
}

export async function getStaticPaths() {
const paths = getAllLanguageSlugs();
return {
paths,
fallback: false,
};
}

export async function getStaticProps({ params }) {
const language = getLanguage(params.lang);
return {
props: {
language,
},
};
}

0 comments on commit 7a07766

Please sign in to comment.