feat: add navigation between version 1 and 2

This commit is contained in:
Stevan Freeborn
2023-04-10 23:20:07 -05:00
parent 39449a5e0f
commit 7d7bffc20a
10 changed files with 106 additions and 59 deletions
+3 -3
View File
@@ -3,7 +3,7 @@ import fs from 'fs';
import path from 'path';
import React, { ReactNode } from 'react';
import Code from '../components/Code';
import { Doc, Section } from './../types/types';
import { Doc, DocSection } from './../types/types';
const DOCS_PATH = path.join(process.cwd(), 'src/docs');
function getCopyPath(version: string, doc: Doc): string {
@@ -78,8 +78,8 @@ function getExampleChild(version: string, doc: Doc) {
export function loadSections(
version: string,
docs: Doc[],
sections: Section[] = []
): Section[] {
sections: DocSection[] = []
): DocSection[] {
for (const doc of docs) {
sections.push({
title: doc.title,