Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add table of content on the home page, remove read docs link (r… #141

Merged
merged 15 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 39 additions & 48 deletions src/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,50 +1,51 @@
import React from 'react';
import clsx from 'clsx';
import Layout from '@theme/Layout';
import Link from '@docusaurus/Link';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import useBaseUrl from '@docusaurus/useBaseUrl';
import React from "react";
import clsx from "clsx";
import Layout from "@theme/Layout";
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
import useBaseUrl from "@docusaurus/useBaseUrl";
import TableOfContents from "@site/table_of_content.mdx";

import styles from './styles.module.css';
import styles from "./styles.module.css";

const features = [
{
title: 'Modular and Configurable',
imageUrl: 'img/undraw_Content_creator_re_pt5b.svg',
title: "Modular and Configurable",
imageUrl: "img/undraw_Content_creator_re_pt5b.svg",
description: (
<>
Honeycomb was designed to be modular, composable, easily configured to deploy to Linux, Mac,

Windows, Browsers, PsiTurk, and more

Honeycomb was designed to be modular, composable, easily configured to
deploy to Linux, Mac, Windows, Browsers, PsiTurk, and more
</>
),
},
{
title: 'Packed with automation',
imageUrl: 'img/undraw_User_flow_re_bvfx.svg',
title: "Packed with automation",
imageUrl: "img/undraw_User_flow_re_bvfx.svg",
description: (
<>Honeycomb includes GitHub Actions that build the executables/deployments for you.</>
<>
Honeycomb includes GitHub Actions that build the executables/deployments
for you.
</>
),
},
{
title: 'Based on trusted and mature libraries',
imageUrl: 'img/undraw_Code_review_re_woeb.svg',
description: <>Honeycomb relies on mature libraries such as JSPsych, React and Electron</>,
title: "Based on trusted and mature libraries",
imageUrl: "img/undraw_Code_review_re_woeb.svg",
description: (
<>
Honeycomb relies on mature libraries such as JSPsych, React and Electron
</>
),
},
];

function Feature({ imageUrl, title, description }) {
const imgUrl = useBaseUrl(imageUrl);
return (
<div className={clsx('col col--4', styles.feature)}>
<div className={clsx("col col--4", styles.feature)}>
{imgUrl && (
<div className='text--center'>
<img
className={styles.featureImage}
src={imgUrl}
alt={title}
/>
<div className="text--center">
<img className={styles.featureImage} src={imgUrl} alt={title} />
</div>
)}
<h3>{title}</h3>
Expand All @@ -59,35 +60,25 @@ function Home() {
return (
<Layout
title={`${siteConfig.title}`}
description='Description will go into a meta tag in <head />'
description="Description will go into a meta tag in <head />"
>
<header className={clsx('hero', styles.heroBanner)}>
<div className='container'>
<h1 className='hero__title'>{siteConfig.title}</h1>
<p className='hero__subtitle'>{siteConfig.tagline}</p>
<div className={styles.buttons}>
<Link
className={clsx(
'button button--outline button--secondary button--lg',
styles.getStarted
)}
to={useBaseUrl('/docs')}
>
Read the Docs
</Link>
</div>
<header className={clsx("hero", styles.heroBanner)}>
<div className="container">
<h1 className="hero__title">{siteConfig.title}</h1>
<p className="hero__subtitle">{siteConfig.tagline}</p>
</div>
<div className={styles.TOC}>
<TableOfContents />
</div>
</header>

<main>
{features && features.length > 0 && (
<section className={styles.features}>
<div className='container'>
<div className='row'>
<div className="container">
<div className="row">
{features.map((props, idx) => (
<Feature
key={idx}
{...props}
/>
<Feature key={idx} {...props} />
))}
</div>
</div>
Expand Down
36 changes: 36 additions & 0 deletions src/pages/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
text-align: center;
position: relative;
overflow: hidden;
display: flex;
flex-direction: column;
}

@media screen and (max-width: 966px) {
Expand All @@ -35,3 +37,37 @@
height: 200px;
width: 200px;
}

/**
* For table of content items
*/
.TOC {
display: flex;
flex-direction: column;
align-items: center;
justify-self: center;
margin: 1.5vh 0;
padding: 0;

> ul {
display: inline-block;
text-align: center;
list-style: none;
padding: 0;
margin: 0;

> li {
margin-bottom: 1.5vh;
font-size: large;

> ul {
text-align: center;
list-style: none;
padding: 0;
margin: 0;
font-size: smaller;
}
}
}
}

30 changes: 30 additions & 0 deletions table_of_content.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
id: table_of_content
slug: /tableofcontent
title: Table of Content
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you rename these to be plural, e.g. "Table of Contents"

description: A table of content for the home page
---

## Table of Contents

- [Introduction](./docs)
- [Quick Start](./docs/quick_start)
- [Prerequisites](./docs/prerequisites)
- Project Organization
- [Directory Structure](./docs/directory_structure)
- [NPM Scripts](./docs/npm_scripts)
- [Environment Variables](./docs/environment_variables)
- [Continuous Integration / Deployment](./docs/ci_cd)
- Deployment
- [Local Application](./docs/local_application)
- [Firebase](./docs/firebase)
- [PsiTurk](./docs/psiturk)
- [GitHub Pages](./docs/gh_pages)
- External Tools
- [Event Triggers](./docs/event_triggers)
- [Prolific](./docs/prolific)
- Further Reading
- [Github Discussions](./docs/github_discussions)
- [Version Control](./docs/version_control)
- [JavaScript](./docs/javascript)
- [Trouble Shooting](./docs/troubleshooting)