diff --git a/src/App.css b/src/App.css index f6b938a..ec1e352 100644 --- a/src/App.css +++ b/src/App.css @@ -107,6 +107,16 @@ text-decoration: none; } +.plain-link { + color: inherit; + text-decoration: none; +} + +.plain-link:hover { + text-decoration: none; + color: #444; +} + .side-nav-item { padding: 0.5rem 0.75rem; width: 100%; diff --git a/src/App.js b/src/App.js index a5f4544..3a3b020 100644 --- a/src/App.js +++ b/src/App.js @@ -15,6 +15,7 @@ import Chapter from "./components/Chapter"; import { content } from "./content/index"; import Sidebar from "./components/Sidebar"; import Header from "./components/Header"; +import TableOfContentsPage from "./pages/TableOfContentsPage"; import { useEffect } from "react"; const chapters = content.reduce((chapters, item) => ( item.content @@ -40,7 +41,7 @@ function App(props) { /> - {chapters[0]} + {chapters.map((chapter) => ( diff --git a/src/content/index.js b/src/content/index.js index a37d0b8..a9151e6 100644 --- a/src/content/index.js +++ b/src/content/index.js @@ -7,7 +7,7 @@ */ /* eslint-disable import/no-webpack-loader-syntax */ -import * as about from "!babel-loader!mdx-loader!./about.mdx"; +import * as intro from "!babel-loader!mdx-loader!./intro.mdx"; import * as presentEquative from "!babel-loader!mdx-loader!./equatives/present-equative.mdx" import * as subjunctiveHabitualEquative from "!babel-loader!mdx-loader!./equatives/subjunctive-habitual-equative.mdx"; @@ -29,8 +29,8 @@ import * as inflectionPatterns from "!babel-loader!mdx-loader!./inflection/infle const contentTree = [ { - import: about, - slug: "about", + import: intro, + slug: "intro", }, { heading: "Equatives", diff --git a/src/content/about.mdx b/src/content/intro.mdx similarity index 100% rename from src/content/about.mdx rename to src/content/intro.mdx diff --git a/src/pages/TableOfContentsPage.js b/src/pages/TableOfContentsPage.js new file mode 100644 index 0000000..47905d3 --- /dev/null +++ b/src/pages/TableOfContentsPage.js @@ -0,0 +1,45 @@ +/** + * Copyright (c) 2021 lingdocs.com + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + +import React from 'react'; +import { Link } from "react-router-dom"; +import Footer from "../components/Footer"; +import { content } from "../content/index"; + +const TableOfContentsPage = () => { + return <> +
+
+

Table of Contents

+ {content.map((section) => ( + section.path ? + +

{section.frontMatter.title}

+ + :
+ +

{section.heading}

+ +
+ {section.chapters.map((chapter) => ( + +
+ {chapter.frontMatter.title} +
+ + ))} +
+
+ ))} +
+
+ ; +}; + +export default TableOfContentsPage; \ No newline at end of file