Skip to content

Commit

Permalink
add customisable welcome message and FAQ on index page (#1952)
Browse files Browse the repository at this point in the history
  • Loading branch information
theosanderson authored May 19, 2024
1 parent 9db32da commit 8b2563c
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 6 deletions.
3 changes: 3 additions & 0 deletions website/src/components/IndexPage/FAQ.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: FAQ
---
7 changes: 7 additions & 0 deletions website/src/components/IndexPage/WelcomeMessage.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
const websiteName = Astro.props.websiteName;
---

<p class='text-gray-700 my-4'>
Welcome to {websiteName}, a system for sharing pathogen genome data.
</p>
2 changes: 1 addition & 1 deletion website/src/layouts/DocLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const { frontmatter } = Astro.props;
<BaseLayout title={frontmatter.title}>
<div class='flex justify-between max-w-5xl mx-auto items-start gap-10'>
<DocMenu />
<div class='mdContainer text-gray-700 leading-relaxed'>
<div class='mdContainer mdContainerItself text-gray-700 leading-relaxed'>
<h1>{frontmatter.title}</h1>
<slot />
</div>
Expand Down
2 changes: 1 addition & 1 deletion website/src/layouts/MdLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const { frontmatter } = Astro.props;
---

<BaseLayout title={frontmatter.title}>
<div class='mdContainer'>
<div class='mdContainer mdContainerItself'>
<slot />
</div>
</BaseLayout>
11 changes: 8 additions & 3 deletions website/src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
---
import Faq from '../components/IndexPage/FAQ.mdx';
import WelcomeMessage from '../components/IndexPage/WelcomeMessage.astro';
import { getConfiguredOrganisms, getWebsiteConfig } from '../config';
import BaseLayout from '../layouts/BaseLayout.astro';
import { routes } from '../routes/routes';
const websiteConfig = getWebsiteConfig();
const { name: websiteName } = websiteConfig;
import '../styles/mdcontainer.scss';
---

<BaseLayout title='Home'>
<div class='max-w-6xl mx-auto'>
<p class='text-gray-700 my-4'>
Welcome to {websiteName}, a system for sharing pathogen genome data.
</p>
<WelcomeMessage websiteName={websiteName} />

<h2 class='font-semibold text-gray-700 my-3 text-lg'>Explore {websiteName} data!</h2>

<div class='flex flex-wrap'>
Expand All @@ -27,5 +29,8 @@ const { name: websiteName } = websiteConfig;
))
}
</div>
<div class='mdContainer'>
<Faq />
</div>
</div>
</BaseLayout>
2 changes: 1 addition & 1 deletion website/src/styles/mdcontainer.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

.mdContainer{
.mdContainerItself{
@apply max-w-3xl mx-auto break-normal;
}

Expand Down

0 comments on commit 8b2563c

Please sign in to comment.