parent
de53dcf02d
commit
6216c3051e
6 changed files with 106 additions and 30 deletions
@ -0,0 +1,42 @@ |
||||
--- |
||||
import type { GuideFileType } from '../lib/guide'; |
||||
|
||||
export interface Props { |
||||
guide: GuideFileType; |
||||
} |
||||
|
||||
const { guide } = Astro.props; |
||||
const { frontmatter } = guide; |
||||
const { author } = frontmatter; |
||||
--- |
||||
|
||||
<div class='bg-white border-b py-5 sm:py-12'> |
||||
<div class='container text-left sm:text-center'> |
||||
<p |
||||
class='text-gray-400 hidden sm:flex items-center justify-start sm:justify-center' |
||||
> |
||||
<a |
||||
href={author.url} |
||||
target='_blank' |
||||
class='font-medium hover:text-gray-600 inline-flex items-center hover:underline' |
||||
> |
||||
<img src={author.imageUrl} class='w-5 h-5 inline mr-2 rounded-full' /> |
||||
{author.name} |
||||
</a> |
||||
<span class='mx-1.5'>·</span> |
||||
<span class='capitalize'>{frontmatter.type} Guide</span> |
||||
<span class='mx-1.5'>·</span> |
||||
<a |
||||
class='text-blue-400 hover:text-blue-500 hover:underline' |
||||
href={`https://github.com/kamranahmedse/roadmap.sh/tree/master/src/guides/${guide.id}.md`} |
||||
target='_blank'>Improve this Guide</a |
||||
> |
||||
</p> |
||||
<h1 class='text-2xl sm:text-5xl my-0 sm:my-3.5 font-bold'> |
||||
{frontmatter.title} |
||||
</h1> |
||||
<p class='hidden sm:block text-gray-400 text-md'> |
||||
{frontmatter.description} |
||||
</p> |
||||
</div> |
||||
</div> |
@ -1,23 +0,0 @@ |
||||
--- |
||||
import GuideListItem from "../components/GuideListItem.astro"; |
||||
import SimplePageHeader from "../components/SimplePageHeader.astro"; |
||||
import BaseLayout from "../layouts/BaseLayout.astro"; |
||||
import { getAllGuides } from "../lib/guide"; |
||||
|
||||
const guides = await getAllGuides(); |
||||
--- |
||||
|
||||
<BaseLayout title="Guides"> |
||||
<SimplePageHeader |
||||
title="Guides" |
||||
description="Succinct graphical explanations to engineering topics." |
||||
/> |
||||
|
||||
<div class="pb-20 pt-2 bg-gray-50"> |
||||
<div class="container"> |
||||
<div class="mt-3 sm:my-5"> |
||||
{guides.map((guide) => <GuideListItem guide={guide} />)} |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</BaseLayout> |
@ -0,0 +1,32 @@ |
||||
--- |
||||
import GuideHeader from '../../components/GuideHeader.astro'; |
||||
import BaseLayout from '../../layouts/BaseLayout.astro'; |
||||
import { getAllGuides, GuideFileType } from '../../lib/guide'; |
||||
import '../../styles/prism.css'; |
||||
|
||||
export interface Props { |
||||
guide: GuideFileType; |
||||
} |
||||
|
||||
export async function getStaticPaths() { |
||||
const guides = await getAllGuides(); |
||||
|
||||
return guides.map((guide) => ({ |
||||
params: { guideId: guide.id }, |
||||
props: { guide }, |
||||
})); |
||||
} |
||||
|
||||
const { guideId } = Astro.params; |
||||
const { guide } = Astro.props; |
||||
--- |
||||
|
||||
<BaseLayout title='Simple Guide'> |
||||
<GuideHeader guide={guide} /> |
||||
|
||||
<div class='bg-gray-50 py-5 sm:py-10'> |
||||
<div class='container prose prose-code:bg-transparent prose-h2:text-3xl prose-h2:mt-4 prose-h2:mb-2 prose-h3:mt-2 prose-img:mt-1'> |
||||
<guide.Content /> |
||||
</div> |
||||
</div> |
||||
</BaseLayout> |
@ -0,0 +1,23 @@ |
||||
--- |
||||
import GuideListItem from '../../components/GuideListItem.astro'; |
||||
import SimplePageHeader from '../../components/SimplePageHeader.astro'; |
||||
import BaseLayout from '../../layouts/BaseLayout.astro'; |
||||
import { getAllGuides } from '../../lib/guide'; |
||||
|
||||
const guides = await getAllGuides(); |
||||
--- |
||||
|
||||
<BaseLayout title='Guides'> |
||||
<SimplePageHeader |
||||
title='Guides' |
||||
description='Succinct graphical explanations to engineering topics.' |
||||
/> |
||||
|
||||
<div class='pb-20 pt-2 bg-gray-50'> |
||||
<div class='container'> |
||||
<div class='mt-3 sm:my-5'> |
||||
{guides.map((guide) => <GuideListItem guide={guide} />)} |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</BaseLayout> |
Loading…
Reference in new issue