This repository was archived by the owner on Aug 16, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +10
-14
lines changed
src/components/FeaturedPosts Expand file tree Collapse file tree 3 files changed +10
-14
lines changed Original file line number Diff line number Diff line change @@ -44,15 +44,11 @@ async function blogPluginExtended(...pluginOptions){
4444} ;
4545}
4646
47- // Create the gallery page
4847data . actions . addRoute ( {
49- // Add route for the home page
50- path : "/home" ,
48+ path : "/featured-posts" ,
5149exact : true ,
5250
53- // The component to use for the "Home" page route
54- component : "@site/src/components/Home/Home.tsx" ,
55- // These are the props that will be passed to our "Home" page component
51+ component : "@site/src/components/FeaturedPosts/FeaturedPosts.tsx" ,
5652modules : {
5753blogPosts : await Promise . all (
5854allBlogPosts . map ( createRecentPostModule ) ,
File renamed without changes.
Original file line number Diff line number Diff line change 11import React from "react" ;
2- import styles from "./Home .module.css" ;
2+ import styles from "./FeaturedPosts .module.css" ;
33import Layout from "@theme/Layout" ;
44import { Content } from "@theme/BlogPostPage" ;
55import clsx from "clsx" ;
66
7- interface HomeProps {
7+ interface FeaturedPostsProps {
88readonly blogPosts : readonly { readonly Preview : Content ; metadata : any } [ ] ;
99}
1010
11- function Home ( { blogPosts } : HomeProps ) : JSX . Element {
11+ function FeaturedPosts ( { blogPosts } : FeaturedPostsProps ) : JSX . Element {
1212return (
1313< Layout >
1414< div className = "container margin-top--lg margin-bottom--lg" >
@@ -19,11 +19,11 @@ function Home({blogPosts }: HomeProps): JSX.Element{
1919</ div >
2020< div className = "row" >
2121{ blogPosts . map ( ( { metadata } , index ) => (
22- < HomeCard
23- key = { `${ metadata . date } -${ index } -home ` }
22+ < FeaturedPostsCard
23+ key = { `${ metadata . date } -${ index } -featured-posts ` }
2424index = { index }
2525metadata = { metadata }
26- context = { "home " }
26+ context = { "featured-posts " }
2727/>
2828) ) }
2929</ div >
@@ -32,9 +32,9 @@ function Home({blogPosts }: HomeProps): JSX.Element{
3232) ;
3333}
3434
35- export default Home ;
35+ export default FeaturedPosts ;
3636
37- export function HomeCard ( { index, metadata, context } ) : JSX . Element {
37+ export function FeaturedPostsCard ( { index, metadata, context } ) : JSX . Element {
3838return (
3939< div className = { `${ clsx ( "col col--3 col--offset-1" ) } ${ styles . card } ` } >
4040< div className = "text--center" >
You can’t perform that action at this time.
0 commit comments