Skip to content

Commit

Permalink
content dirs in page level
Browse files Browse the repository at this point in the history
  • Loading branch information
nofurtherinformation committed Apr 11, 2024
1 parent 421e5db commit f35e05b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/county/[county]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from "react"
import path from "path"
import { getSummaryStats } from "utils/data/summaryStats"
import { getContentDirs } from "utils/contentDirs"

type CountyRouteProps = {
params: {
Expand Down Expand Up @@ -36,9 +37,10 @@ type CountyDataMap = Map<CountyDataKeys, CountyDataValues>


const CountyPage: React.FC<CountyRouteProps> = async ({ params }) => {
// dynamic routes to use mdx content
getContentDirs()
const county = params.county
const countyDataPath = path.join(process.cwd(), "public", "data", `county_summary_stats.msgpack`)

const countyStats = await getSummaryStats<CountyDataMap>(countyDataPath, county)

return (
Expand Down

0 comments on commit f35e05b

Please sign in to comment.