diff --git a/_db/gtworld/2023.json b/_db/gtworld/2023.json new file mode 100644 index 00000000..5987e5d0 --- /dev/null +++ b/_db/gtworld/2023.json @@ -0,0 +1,274 @@ +{ + "races": [ + { + "name": "Sonoma Raceway", + "location": "United States of America", + "sessions": { + "race": "2023-03-30T12:00:00Z" + }, + "series": "GT World Challenge America", + "dates": "2023-03-30/2023-04-02" + }, + { + "name": "Mount Panorama, Bathurst", + "location": "Australia", + "sessions": { + "race": "2023-04-07T12:00:00Z" + }, + "series": "GT World Challenge Australia", + "dates": "2023-04-07/2023-04-09" + }, + { + "name": "Monza", + "location": "Italy", + "sessions": { + "race": "2023-04-20T12:00:00Z" + }, + "series": "Fanatec GT World Challenge Powered by AWS Endurance Cup", + "dates": "2023-04-20/2023-04-23" + }, + { + "name": "NOLA Motorsports Park", + "location": "United States of America", + "sessions": { + "race": "2023-04-28T12:00:00Z" + }, + "series": "GT World Challenge America", + "dates": "2023-04-28/2023-04-30" + }, + { + "name": "Carco.com.au Raceway", + "location": "Australia", + "sessions": { + "race": "2023-04-28T12:00:00Z" + }, + "series": "GT World Challenge Australia", + "dates": "2023-04-28/2023-04-30" + }, + { + "name": "Chang International Circuit", + "location": "Thailand", + "sessions": { + "race": "2023-05-11T12:00:00Z" + }, + "series": "Fanatec GT World Challenge Asia", + "dates": "2023-05-11/2023-05-14" + }, + { + "name": "Phillip Island Grand Prix Circuit", + "location": "Australia", + "sessions": { + "race": "2023-05-12T12:00:00Z" + }, + "series": "GT World Challenge Australia", + "dates": "2023-05-12/2023-05-14" + }, + { + "name": "Brands Hatch", + "location": "Great Britain", + "sessions": { + "race": "2023-05-13T12:00:00Z" + }, + "series": "Fanatec GT World Challenge Powered by AWS Sprint Cup", + "dates": "2023-05-13/2023-05-14" + }, + { + "name": "Circuit of the Americas", + "location": "United States of America", + "sessions": { + "race": "2023-05-19T12:00:00Z" + }, + "series": "GT World Challenge America", + "dates": "2023-05-19/2023-05-21" + }, + { + "name": "Circuit Paul Ricard", + "location": "France", + "sessions": { + "race": "2023-06-01T12:00:00Z" + }, + "series": "Fanatec GT World Challenge Powered by AWS Endurance Cup", + "dates": "2023-06-01/2023-06-04" + }, + { + "name": "Fuji International Speedway", + "location": "Japan", + "sessions": { + "race": "2023-06-15T12:00:00Z" + }, + "series": "Fanatec GT World Challenge Asia", + "dates": "2023-06-15/2023-06-18" + }, + { + "name": "VIRginia International Raceway", + "location": "United States of America", + "sessions": { + "race": "2023-06-16T12:00:00Z" + }, + "series": "GT World Challenge America", + "dates": "2023-06-16/2023-06-18" + }, + { + "name": "CrowdStrike 24 Hours of Spa", + "location": "Belgium", + "sessions": { + "race": "2023-06-27T12:00:00Z" + }, + "series": "Fanatec GT World Challenge Powered by AWS Endurance Cup", + "dates": "2023-06-27/2023-07-02" + }, + { + "name": "Misano", + "location": "Italy", + "sessions": { + "race": "2023-07-13T12:00:00Z" + }, + "series": "Fanatec GT World Challenge Powered by AWS Sprint Cup", + "dates": "2023-07-13/2023-07-16" + }, + { + "name": "Suzuka International Circuit", + "location": "Japan", + "sessions": { + "race": "2023-07-14T12:00:00Z" + }, + "series": "Fanatec GT World Challenge Asia", + "dates": "2023-07-14/2023-07-16" + }, + { + "name": "Motegi", + "location": "Japan", + "sessions": { + "race": "2023-07-21T12:00:00Z" + }, + "series": "Fanatec GT World Challenge Asia", + "dates": "2023-07-21/2023-07-23" + }, + { + "name": "Sydney Motorsport Park", + "location": "Australia", + "sessions": { + "race": "2023-07-28T12:00:00Z" + }, + "series": "GT World Challenge Australia", + "dates": "2023-07-28/2023-07-30" + }, + { + "name": "Nürburgring", + "location": "Germany", + "sessions": { + "race": "2023-07-28T12:00:00Z" + }, + "series": "Fanatec GT World Challenge Powered by AWS Endurance Cup", + "dates": "2023-07-28/2023-07-30" + }, + { + "name": "Queensland Raceway", + "location": "Australia", + "sessions": { + "race": "2023-08-11T12:00:00Z" + }, + "series": "GT World Challenge Australia", + "dates": "2023-08-11/2023-08-13" + }, + { + "name": "Okayama International Circuit", + "location": "Japan", + "sessions": { + "race": "2023-08-17T12:00:00Z" + }, + "series": "Fanatec GT World Challenge Asia", + "dates": "2023-08-17/2023-08-20" + }, + { + "name": "Road America", + "location": "United States of America", + "sessions": { + "race": "2023-08-18T12:00:00Z" + }, + "series": "GT World Challenge America", + "dates": "2023-08-18/2023-08-20" + }, + { + "name": "Hockenheim", + "location": "Germany", + "sessions": { + "race": "2023-08-31T12:00:00Z" + }, + "series": "Fanatec GT World Challenge Powered by AWS Sprint Cup", + "dates": "2023-08-31/2023-09-03" + }, + { + "name": "Circuit Ricardo Tormo Valencia", + "location": "Spain", + "sessions": { + "race": "2023-09-14T12:00:00Z" + }, + "series": "Fanatec GT World Challenge Powered by AWS Sprint Cup", + "dates": "2023-09-14/2023-09-17" + }, + { + "name": "Sepang International Circuit", + "location": "Malaysia", + "sessions": { + "race": "2023-09-21T12:00:00Z" + }, + "series": "Fanatec GT World Challenge Asia", + "dates": "2023-09-21/2023-09-24" + }, + { + "name": "Sebring International Raceway", + "location": "United States of America", + "sessions": { + "race": "2023-09-22T12:00:00Z" + }, + "series": "GT World Challenge America", + "dates": "2023-09-22/2023-09-24" + }, + { + "name": "Barcelona", + "location": "Spain", + "sessions": { + "race": "2023-09-29T12:00:00Z" + }, + "series": "Fanatec GT World Challenge Powered by AWS Endurance Cup", + "dates": "2023-09-29/2023-10-01" + }, + { + "name": "Indianapolis Motor Speedway", + "location": "United States of America", + "sessions": { + "race": "2023-10-05T12:00:00Z" + }, + "series": "GT World Challenge America", + "dates": "2023-10-05/2023-10-08" + }, + { + "name": "AWARDS Banquet", + "location": "United States of America", + "sessions": { + "race": "2023-10-08T12:00:00Z" + }, + "series": "GT World Challenge America", + "dates": "2023-10-08" + }, + { + "name": "Zandvoort", + "location": "Netherlands", + "sessions": { + "race": "2023-10-12T12:00:00Z" + }, + "series": "Fanatec GT World Challenge Powered by AWS Sprint Cup", + "dates": "2023-10-12/2023-10-15" + }, + { + "name": "Adelaide Parklands Circuit", + "location": "Australia", + "sessions": { + "race": "2023-11-23T12:00:00Z" + }, + "series": "GT World Challenge Australia", + "dates": "2023-11-23/2023-11-26" + } + ] +} diff --git a/_db/gtworld/config.json b/_db/gtworld/config.json new file mode 100644 index 00000000..3421eccb --- /dev/null +++ b/_db/gtworld/config.json @@ -0,0 +1 @@ +{"siteKey": "gtworld", "url": "/gtworld/2023", "calendarCDN": "files-wec.motorsportcalendars.com", "availableYears": [2022, 2023, 2024], "sessions": ["freePractice", "qualifying", "race"], "featuredSessions": ["race"], "collapsedSessions": ["freePractice", "qualifying"], "sessionMap": {"freePractice": "fp", "qualifying": "qualifying", "race": "race"}, "sessionLengths": {"freePractice": 60, "qualifying": 30, "race": 360}, "supportsEmailReminders": false, "notice": "Calendar will be updated as details are confirmed. Contributions to keep IMSA Calendar up to date are appreciated."} \ No newline at end of file diff --git a/_db/imsa/2022.json b/_db/imsa/2022.json new file mode 100644 index 00000000..f7ffc5c9 --- /dev/null +++ b/_db/imsa/2022.json @@ -0,0 +1,147 @@ +{ + "races": [ + { + "name": "Roar Before The Rolex 24 Presented by INX", + "location": "Daytona International Speedway", + "sessions": { + "race": "2022-01-21T12:00:00Z" + }, + "duration": "N/A", + "length": "3.56 miles", + "corners": 12, + "dates": "2022-01-21/2022-01-23" + }, + { + "name": "Rolex 24 At Daytona", + "location": "Daytona International Speedway", + "sessions": { + "race": "2022-01-26T14:00:00Z" + }, + "duration": "24 Hours", + "length": "3.56 miles", + "corners": 12, + "dates": "2022-01-26/2022-01-30" + }, + { + "name": "Mobil 1 Twelve Hours of Sebring Presented by Advance Auto Parts", + "location": "Sebring International Raceway", + "sessions": { + "race": "2022-03-16T12:00:00Z" + }, + "duration": "12 Hours", + "length": "3.74 miles", + "corners": 17, + "dates": "2022-03-16/2022-03-19" + }, + { + "name": "Acura Grand Prix of Long Beach", + "location": "Long Beach Street Circuit", + "sessions": { + "race": "2022-04-08T12:00:00Z" + }, + "duration": "100 Minutes", + "length": "1.968 miles", + "corners": 11, + "dates": "2022-04-08/2022-04-10" + }, + { + "name": "Hyundai Monterey Sports Car Championship Presented by Motul", + "location": "WeatherTech Raceway Laguna Seca", + "sessions": { + "race": "2022-04-29T12:00:00Z" + }, + "duration": "2 Hours 40 Minutes", + "length": "2.238 miles", + "corners": 11, + "dates": "2022-04-29/2022-05-01" + }, + { + "name": "Lexus Grand Prix at Mid-Ohio", + "location": "Mid-Ohio Sports Car Course", + "sessions": { + "race": "2022-05-13T12:00:00Z" + }, + "duration": "2 Hours 40 Minutes", + "length": "2.258 miles", + "corners": 13, + "dates": "2022-05-13/2022-05-15" + }, + { + "name": "Chevrolet Detroit Grand Prix Presented by Lear", + "location": "Raceway at Belle Isle Park", + "sessions": { + "race": "2022-06-03T12:00:00Z" + }, + "duration": "100 Minutes", + "length": "2.35 miles", + "corners": 14, + "dates": "2022-06-03/2022-06-04" + }, + { + "name": "Sahlen's Six Hours of The Glen", + "location": "Watkins Glen International", + "sessions": { + "race": "2022-06-23T12:00:00Z" + }, + "duration": "6 Hours", + "length": "3.4 miles", + "corners": 11, + "dates": "2022-06-23/2022-06-26" + }, + { + "name": "Chevrolet Grand Prix", + "location": "Canadian Tire Motorsport Park", + "sessions": { + "race": "2022-07-01T12:00:00Z" + }, + "duration": "2 Hours 40 Minutes", + "length": "2.459 miles", + "corners": 10, + "dates": "2022-07-01/2022-07-03" + }, + { + "name": "FCP Euro Northeast Grand Prix", + "location": "Lime Rock Park", + "sessions": { + "race": "2022-07-15T12:00:00Z" + }, + "duration": "2 Hours 40 Minutes", + "length": "1.50 miles", + "corners": 7, + "dates": "2022-07-15/2022-07-16" + }, + { + "name": "IMSA Fastlane SportsCar Weekend", + "location": "Road America", + "sessions": { + "race": "2022-08-04T12:00:00Z" + }, + "duration": "2 Hours 40 Minutes", + "length": "4.0 miles", + "corners": 14, + "dates": "2022-08-04/2022-08-07" + }, + { + "name": "Michelin GT Challenge at VIR", + "location": "VIRginia International Raceway", + "sessions": { + "race": "2022-08-26T12:00:00Z" + }, + "duration": "2 Hours 40 Minutes", + "length": "3.27 miles", + "corners": 18, + "dates": "2022-08-26/2022-08-28" + }, + { + "name": "Motul Petit Le Mans", + "location": "Michelin Raceway Road Atlanta", + "sessions": { + "race": "2022-09-28T12:00:00Z" + }, + "duration": "10 Hours", + "length": "2.54 miles", + "corners": 12, + "dates": "2022-09-28/2022-10-01" + } + ] +} diff --git a/_db/imsa/2023.json b/_db/imsa/2023.json new file mode 100644 index 00000000..059b9147 --- /dev/null +++ b/_db/imsa/2023.json @@ -0,0 +1,136 @@ +{ + "races": [ + { + "name": "Roar Before the Rolex 24", + "location": "Daytona International Speedway", + "sessions": { + "race": "2023-01-20T12:00:00Z" + }, + "duration": "N/A", + "length": "3.56 miles", + "corners": 12, + "dates": "2023-01-20/2023-01-22" + }, + { + "name": "Rolex 24 At Daytona", + "location": "Daytona International Speedway", + "sessions": { + "race": "2023-01-26T14:00:00Z" + }, + "duration": "24 Hours", + "length": "3.56 miles", + "corners": 12, + "dates": "2023-01-26/2023-01-29" + }, + { + "name": "Mobil 1 Twelve Hours of Sebring", + "location": "Sebring International Raceway", + "sessions": { + "race": "2023-03-15T12:00:00Z" + }, + "duration": "12 Hours", + "length": "3.74 miles", + "corners": 17, + "dates": "2023-03-15/2023-03-18" + }, + { + "name": "Acura Grand Prix of Long Beach", + "location": "Long Beach Street Circuit", + "sessions": { + "race": "2023-04-14T12:00:00Z" + }, + "duration": "100 Minutes", + "length": "1.968 miles", + "corners": 11, + "dates": "2023-04-14/2023-04-16" + }, + { + "name": "Motul Course de Monterey Powered by Hyundai N", + "location": "WeatherTech Raceway Laguna Seca", + "sessions": { + "race": "2023-05-12T12:00:00Z" + }, + "duration": "2 Hours 40 Minutes", + "length": "2.238 miles", + "corners": 11, + "dates": "2023-05-12/2023-05-14" + }, + { + "name": "Sahlen's Six Hours of The Glen", + "location": "Watkins Glen International", + "sessions": { + "race": "2023-06-22T12:00:00Z" + }, + "duration": "6 Hours", + "length": "3.4 miles", + "corners": 11, + "dates": "2023-06-22/2023-06-25" + }, + { + "name": "Chevrolet Grand Prix", + "location": "Canadian Tire Motorsport Park", + "sessions": { + "race": "2023-07-07T12:00:00Z" + }, + "duration": "2 Hours 40 Minutes", + "length": "2.459 miles", + "corners": 10, + "dates": "2023-07-07/2023-07-09" + }, + { + "name": "FCP Euro Northeast Grand Prix Presented by Liqui Moly", + "location": "Lime Rock Park", + "sessions": { + "race": "2023-07-21T12:00:00Z" + }, + "duration": "2 Hours 40 Minutes", + "length": "1.50 miles", + "corners": 7, + "dates": "2023-07-21/2023-07-22" + }, + { + "name": "IMSA SportsCar Weekend", + "location": "Road America", + "sessions": { + "race": "2023-08-03T12:00:00Z" + }, + "duration": "2 Hours 40 Minutes", + "length": "4.0 miles", + "corners": 14, + "dates": "2023-08-03/2023-08-06" + }, + { + "name": "Michelin GT Challenge at VIR", + "location": "VIRginia International Raceway", + "sessions": { + "race": "2023-08-25T12:00:00Z" + }, + "duration": "2 Hours 40 Minutes", + "length": "3.27 miles", + "corners": 18, + "dates": "2023-08-25/2023-08-27" + }, + { + "name": "Tirerack.com Battle on the Bricks", + "location": "Indianapolis Motor Speedway", + "sessions": { + "race": "2023-09-15T12:00:00Z" + }, + "duration": "2 Hours 40 Minutes", + "length": "2.439 miles", + "corners": 14, + "dates": "2023-09-15/2023-09-17" + }, + { + "name": "Motul Petit Le Mans", + "location": "Michelin Raceway Road Atlanta", + "sessions": { + "race": "2023-10-11T12:00:00Z" + }, + "duration": "10 Hours", + "length": "2.54 miles", + "corners": 12, + "dates": "2023-10-11/2023-10-14" + } + ] +} diff --git a/_db/imsa/config.json b/_db/imsa/config.json new file mode 100644 index 00000000..c818de82 --- /dev/null +++ b/_db/imsa/config.json @@ -0,0 +1 @@ +{"siteKey": "imsa", "url": "/imsa/2023", "calendarCDN": "files-wec.motorsportcalendars.com", "availableYears": [2022, 2023, 2024], "sessions": ["freePractice", "qualifying", "race"], "featuredSessions": ["race"], "collapsedSessions": ["freePractice", "qualifying"], "sessionMap": {"freePractice": "fp", "qualifying": "qualifying", "race": "race"}, "sessionLengths": {"freePractice": 60, "qualifying": 30, "race": 360}, "supportsEmailReminders": false, "notice": "Calendar will be updated as details are confirmed. Contributions to keep IMSA Calendar up to date are appreciated."} \ No newline at end of file diff --git a/_db/sites.json b/_db/sites.json index c149e55c..60ab25d0 100644 --- a/_db/sites.json +++ b/_db/sites.json @@ -39,6 +39,21 @@ "name": "F1 Academy", "url": "https://f1academycalendar.com", "siteKey": "f1-academy" + }, + { + "name": "WEC", + "url": "/wec/2023", + "siteKey": "wec" + }, + { + "name": "IMSA", + "url": "/imsa/2023", + "siteKey": "imsa" + }, + { + "name": "gtworld", + "url": "/gtworld/2023", + "siteKey": "gtworld" } ] } diff --git a/_db/wec/2022.json b/_db/wec/2022.json new file mode 100644 index 00000000..ec3aab00 --- /dev/null +++ b/_db/wec/2022.json @@ -0,0 +1,88 @@ +{ + "races": [ + { + "name": "Sebring Prologue", + "location": "Sebring International Raceway", + "latitude": 27.455, + "longitude": -81.348, + "round": 1, + "slug": "sebring-prologue", + "localeKey": "sebring-prologue", + "sessions": { + "race": "2022-03-13T12:00:00Z" + } + }, + { + "name": "1000 Miles of Sebring", + "location": "Sebring International Raceway", + "latitude": 27.455, + "longitude": -81.348, + "round": 2, + "slug": "sebring-1000-miles", + "localeKey": "sebring-1000-miles", + "sessions": { + "race": "2022-03-18T12:00:00Z" + } + }, + { + "name": "6 Hours of Spa-Francorchamps", + "location": "Circuit de Spa-Francorchamps", + "latitude": 50.4372, + "longitude": 5.9714, + "round": 3, + "slug": "spa-6-hours", + "localeKey": "spa-6-hours", + "sessions": { + "race": "2022-05-07T12:00:00Z" + } + }, + { + "name": "24 Hours of Le Mans", + "location": "Circuit de la Sarthe", + "latitude": 47.956, + "longitude": 0.2077, + "round": 4, + "slug": "le-mans-24-hours", + "localeKey": "le-mans-24-hours", + "sessions": { + "race": "2022-06-11T14:00:00Z" + } + }, + { + "name": "6 Hours of Monza", + "location": "Autodromo Nazionale Monza", + "latitude": 45.6194, + "longitude": 9.2811, + "round": 5, + "slug": "monza-6-hours", + "localeKey": "monza-6-hours", + "sessions": { + "race": "2022-07-10T12:00:00Z" + } + }, + { + "name": "6 Hours of Fuji", + "location": "Fuji Speedway", + "latitude": 35.3717, + "longitude": 138.9275, + "round": 6, + "slug": "fuji-6-hours", + "localeKey": "fuji-6-hours", + "sessions": { + "race": "2022-09-11T11:00:00Z" + } + }, + { + "name": "8 Hours of Bahrain", + "location": "Bahrain International Circuit", + "latitude": 26.0325, + "longitude": 50.5106, + "round": 7, + "slug": "bahrain-8-hours", + "localeKey": "bahrain-8-hours", + "sessions": { + "race": "2022-11-12T14:00:00Z" + } + } + ] +} diff --git a/_db/wec/2023.json b/_db/wec/2023.json new file mode 100644 index 00000000..ae7670b9 --- /dev/null +++ b/_db/wec/2023.json @@ -0,0 +1,88 @@ +{ + "races": [ + { + "name": "1000 Miles of Sebring", + "location": "Sebring International Raceway", + "latitude": 27.455, + "longitude": -81.348, + "round": 1, + "slug": "sebring-1000-miles", + "localeKey": "sebring-1000-miles", + "sessions": { + "race": "2023-03-17T12:00:00Z" + } + }, + { + "name": "6 Hours of Spa-Francorchamps", + "location": "Circuit de Spa-Francorchamps", + "latitude": 50.4372, + "longitude": 5.9714, + "round": 2, + "slug": "spa-6-hours", + "localeKey": "spa-6-hours", + "sessions": { + "race": "2023-05-06T12:00:00Z" + } + }, + { + "name": "24 Hours of Le Mans", + "location": "Circuit de la Sarthe", + "latitude": 47.956, + "longitude": 0.2077, + "round": 3, + "slug": "le-mans-24-hours", + "localeKey": "le-mans-24-hours", + "sessions": { + "race": "2023-06-10T14:00:00Z" + } + }, + { + "name": "6 Hours of Monza", + "location": "Autodromo Nazionale Monza", + "latitude": 45.6194, + "longitude": 9.2811, + "round": 4, + "slug": "monza-6-hours", + "localeKey": "monza-6-hours", + "sessions": { + "race": "2023-07-09T12:00:00Z" + } + }, + { + "name": "6 Hours of Fuji", + "location": "Fuji Speedway", + "latitude": 35.3717, + "longitude": 138.9275, + "round": 5, + "slug": "fuji-6-hours", + "localeKey": "fuji-6-hours", + "sessions": { + "race": "2023-09-10T11:00:00Z" + } + }, + { + "name": "8 Hours of Bahrain", + "location": "Bahrain International Circuit", + "latitude": 26.0325, + "longitude": 50.5106, + "round": 6, + "slug": "bahrain-8-hours", + "localeKey": "bahrain-8-hours", + "sessions": { + "race": "2023-11-04T14:00:00Z" + } + }, + { + "name": "8 Hours of Portimao", + "location": "Autódromo Internacional do Algarve", + "latitude": 37.227, + "longitude": -8.6267, + "round": 7, + "slug": "portimao-8-hours", + "localeKey": "portimao-8-hours", + "sessions": { + "race": "2023-10-01T12:00:00Z" + } + } + ] +} diff --git a/_db/wec/config.json b/_db/wec/config.json new file mode 100644 index 00000000..cc20176e --- /dev/null +++ b/_db/wec/config.json @@ -0,0 +1 @@ +{"siteKey": "wec", "url": "/wec/2023", "calendarCDN": "files-wec.motorsportcalendars.com", "availableYears": [2022, 2023, 2024], "sessions": ["freePractice", "qualifying", "race"], "featuredSessions": ["race"], "collapsedSessions": ["freePractice", "qualifying"], "sessionMap": {"freePractice": "fp", "qualifying": "qualifying", "race": "race"}, "sessionLengths": {"freePractice": 60, "qualifying": 30, "race": 360}, "supportsEmailReminders": false, "notice": "Calendar will be updated as details are confirmed. Contributions to keep WEC Calendar up to date are appreciated."} \ No newline at end of file diff --git a/pages/gtworld/[year].js b/pages/gtworld/[year].js new file mode 100644 index 00000000..cf9287d0 --- /dev/null +++ b/pages/gtworld/[year].js @@ -0,0 +1,41 @@ +import FullWidthLayout from "../../components/layout/FullWidthLayout"; +import Races from "../../components/Races/Races"; +import { NextSeo } from "next-seo"; +import OptionsBar from "../../components/OptionsBar/OptionsBar"; // Ensure this component is correctly imported + +const gtworldYear = ({ year, races }) => { + return ( + + +
{/* Container with max-width and center alignment */} +
{/* Padding */} + {/* OptionsBar component for consistency */} +
+ +
{/* Responsive padding */} +

gtworld {year} Schedule

+ +
+
+
+ ); +}; + +export async function getStaticPaths() { + const years = [2022, 2023, 2024]; // WEC available years + const paths = years.map((year) => ({ params: { year: year.toString() } })); + return { paths, fallback: false }; +} + +export async function getStaticProps({ params }) { + const year = params.year; + const data = await import(`../../_db/gtworld/${year}.json`); + return { + props: { + year, + races: data.races, + }, + }; +}; + +export default gtworldYear; diff --git a/pages/imsa/[year].js b/pages/imsa/[year].js new file mode 100644 index 00000000..f4986abd --- /dev/null +++ b/pages/imsa/[year].js @@ -0,0 +1,41 @@ +import FullWidthLayout from "../../components/layout/FullWidthLayout"; +import Races from "../../components/Races/Races"; +import { NextSeo } from "next-seo"; +import OptionsBar from "../../components/OptionsBar/OptionsBar"; // Ensure this component is correctly imported + +const IMSAYear = ({ year, races }) => { + return ( + + +
{/* Container with max-width and center alignment */} +
{/* Padding */} + {/* OptionsBar component for consistency */} +
+ +
{/* Responsive padding */} +

IMSA {year} Schedule

+ +
+
+
+ ); +}; + +export async function getStaticPaths() { + const years = [2022, 2023, 2024]; // WEC available years + const paths = years.map((year) => ({ params: { year: year.toString() } })); + return { paths, fallback: false }; +} + +export async function getStaticProps({ params }) { + const year = params.year; + const data = await import(`../../_db/imsa/${year}.json`); + return { + props: { + year, + races: data.races, + }, + }; +}; + +export default IMSAYear; diff --git a/pages/wec/[year].js b/pages/wec/[year].js new file mode 100644 index 00000000..460a3468 --- /dev/null +++ b/pages/wec/[year].js @@ -0,0 +1,41 @@ +import FullWidthLayout from "../../components/layout/FullWidthLayout"; +import Races from "../../components/Races/Races"; +import { NextSeo } from "next-seo"; +import OptionsBar from "../../components/OptionsBar/OptionsBar"; // Ensure this component is correctly imported + +const WECYear = ({ year, races }) => { + return ( + + +
{/* Container with max-width and center alignment */} +
{/* Padding */} + {/* OptionsBar component for consistency */} +
+ +
{/* Responsive padding */} +

WEC {year} Schedule

+ +
+
+
+ ); +}; + +export async function getStaticPaths() { + const years = [2022, 2023, 2024]; // WEC available years + const paths = years.map((year) => ({ params: { year: year.toString() } })); + return { paths, fallback: false }; +} + +export async function getStaticProps({ params }) { + const year = params.year; + const data = await import(`../../_db/wec/${year}.json`); + return { + props: { + year, + races: data.races, + }, + }; +}; + +export default WECYear;