MCPcopy Create free account
hub / github.com/nodejs/nodejs.org / PostLayout

Function PostLayout

apps/site/layouts/Post.tsx:17–57  ·  view source on GitHub ↗
({ children })

Source from the content-addressed store, hash-verified

15import styles from './layouts.module.css';
16
17const PostLayout: FC<PropsWithChildren> = ({ children }) => {
18 const { frontmatter } = getClientContext();
19
20 const authors = mapAuthorToCardAuthors(frontmatter.author!);
21
22 const type = mapBlogCategoryToPreviewType(frontmatter.category!);
23
24 return (
25 <>
26 <WithNavBar />
27
28 <div className={styles.contentLayout}>
29 <div></div>
30
31 <div className={styles.postLayout}>
32 <main id="main" tabIndex={-1}>
33 {type === 'vulnerability' && <EOLAlert />}
34
35 <h1>{frontmatter.title}</h1>
36
37 <section>
38 <WithAvatarGroup names={authors} size="medium" />
39
40 <p>{authors.join(', ')}</p>
41 </section>
42
43 <Preview title={frontmatter.title!} type={type} />
44
45 {children}
46
47 <WithBlogCrossLinks />
48 </main>
49 </div>
50
51 <WithMetaBar />
52 </div>
53
54 <WithFooter />
55 </>
56 );
57};
58
59export default PostLayout;

Callers

nothing calls this directly

Calls 2

mapAuthorToCardAuthorsFunction · 0.90

Tested by

no test coverage detected