Skip to content

Commit

Permalink
Reformatted file
Browse files Browse the repository at this point in the history
  • Loading branch information
felder101 committed Mar 28, 2024
1 parent 25ff4da commit 05604b6
Showing 1 changed file with 48 additions and 50 deletions.
98 changes: 48 additions & 50 deletions src/pages/policies-and-audits/[...slug].astro
Original file line number Diff line number Diff line change
Expand Up @@ -8,62 +8,60 @@ import PageLayout from '@layouts/PageLayout.astro';
import PageContentLayout from '@layouts/PageContentLayout.astro';
import SideNav from '@components/SideNav.astro'
import FullSizeTemplate from '@components/FullSizeTemplate.astro'
import {getCollection} from 'astro:content';
import { getCollection } from 'astro:content';
export async function getStaticPaths() {
const entries = await getCollection('policies-and-audits');
const entries = await getCollection('policies-and-audits');
return entries.map(entry => {
const slug = entry.slug == './' ? undefined : entry.slug
return {
params: {slug: slug},
props: {entry, entries}
}
})
return entries.map(entry => {
const slug = entry.slug == './' ? undefined : entry.slug
return {
params: { slug: slug },
props: { entry, entries }
}
})
}
const {entry, entries} = Astro.props;
const {Content, headings} = await entry.render();
const parent_path = "policies-and-audits/"
const { entry, entries } = Astro.props;
const { Content, headings } = await entry.render();
const parent_path ="policies-and-audits/"
---

<PageLayout title={entry.data.title}>
{entry.data.full_size_template
? (
<FullSizeTemplate
title={entry.data.title}
parent_nav_path="policies-and-audits"
parent_nav_text="Return to the Policies & Audits"
intro={entry.data.intro}
>
<Content/>
</FullSizeTemplate>
)
: (
<!-- One of two sidenav's only shown in desktop breakpoints. -->
<SideNav
title="Policies & Audits"
parent_path={parent_path}
pages={[...entries]}
headings={headings}
id={entry.id}
classList="usa-layout-docs__sidenav display-none desktop:display-block desktop:grid-col-4"
/>
<PageContentLayout
title={entry.data.title}
intro={entry.data.intro}
>
<Content/>
</PageContentLayout>
<!-- New duplicate section only shown on mobile. -->
<SideNav
title="Policies & Audits"
parent_path={parent_path}
pages={[...entries]}
headings={headings}
id={entry.id}
classList="usa-layout-docs__sidenav desktop:display-none mobile:grid-col-12"
/>
)
}
{entry.data.full_size_template
? (
<FullSizeTemplate
title={ entry.data.title }
parent_nav_path="policies-and-audits"
parent_nav_text = "Return to the Policies & Audits"
intro ={entry.data.intro}
>
<Content />
</FullSizeTemplate>
)
: (
<SideNav
title="Policies & Audits"
parent_path={parent_path}
pages={[...entries]}
headings={headings}
id={entry.id}
classList = "usa-layout-docs__sidenav display-none desktop:display-block desktop:grid-col-4"
/>
<PageContentLayout
title={entry.data.title}
intro={entry.data.intro}
>
<Content />
</PageContentLayout>
<SideNav
title="Policies & Audits"
parent_path={parent_path}
pages={[...entries]}
headings={headings}
id={entry.id}
classList = "usa-layout-docs__sidenav desktop:display-none mobile:grid-col-12"
/>
)
}
</PageLayout>

0 comments on commit 05604b6

Please sign in to comment.