diff --git a/Dockerfile b/Dockerfile index 48e7c7f45..4310757e4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -146,6 +146,7 @@ ARG NEXT_TELEMETRY_DISABLED \ NEXT_PUBLIC_APP_NAME="charterAFRICA" \ NEXT_PUBLIC_APP_URL \ NEXT_PUBLIC_SENTRY_DSN \ + NEXT_PUBLIC_SEO_DISABLED \ # Payload (runtime) MONGO_URL \ # TODO(koech): Standadise naming of Payload Secret. Our options: @@ -167,6 +168,7 @@ COPY apps/charterafrica ./apps/charterafrica/ # When building Next.js app, Next.js needs to connect to local Payload ENV PAYLOAD_PUBLIC_APP_URL=http://localhost:3000 +ENV NEXT_PUBLIC_SEO_DISABLED=${NEXT_PUBLIC_SEO_DISABLED} RUN pnpm --filter "./apps/charterafrica/" build-next # When building Payload app, Payload needs to have final app URL diff --git a/apps/charterafrica/contrib/dokku/Dockerfile b/apps/charterafrica/contrib/dokku/Dockerfile index 481de4776..fceb8357a 100644 --- a/apps/charterafrica/contrib/dokku/Dockerfile +++ b/apps/charterafrica/contrib/dokku/Dockerfile @@ -1 +1 @@ -FROM codeforafrica/charterafrica-ui:0.1.31 +FROM codeforafrica/charterafrica-ui:0.1.33 diff --git a/apps/charterafrica/package.json b/apps/charterafrica/package.json index 6af5bfbbd..ef297b0ce 100644 --- a/apps/charterafrica/package.json +++ b/apps/charterafrica/package.json @@ -1,6 +1,6 @@ { "name": "charterafrica", - "version": "0.1.31", + "version": "0.1.33", "private": true, "author": "Code for Africa ", "description": "This is the official code for https://charter.africa site", diff --git a/apps/engineeringblog/app/layout.tsx b/apps/engineeringblog/app/layout.tsx index 4505b92f9..a46395719 100644 --- a/apps/engineeringblog/app/layout.tsx +++ b/apps/engineeringblog/app/layout.tsx @@ -1,13 +1,13 @@ import { CssBaseline, ThemeProvider } from "@mui/material"; import { AppRouterCacheProvider } from "@mui/material-nextjs/v13-appRouter"; +import { GoogleAnalytics } from "@next/third-parties/google"; import type { Metadata } from "next"; +import logoLight from "@/engineeringblog/assets/images/logo-light.png"; import Footer from "@/engineeringblog/components/Footer"; import NavBar from "@/engineeringblog/components/NavBar"; -import theme from "@/engineeringblog/theme"; - import { getSettings } from "@/engineeringblog/lib/data"; -import logoLight from "@/engineeringblog/assets/images/logo-light.png"; +import theme from "@/engineeringblog/theme"; export const metadata: Metadata = { title: "Technology | Code for Africa", @@ -20,7 +20,7 @@ export default async function RootLayout({ }: Readonly<{ children: React.ReactNode; }>) { - const { connect, primaryNavigation, secondaryNavigation } = + const { analytics, connect, primaryNavigation, secondaryNavigation } = await getSettings(); // TODO: blurWidth/blurHeight https://github.com/vercel/next.js/issues/56511 const { blurWidth, blurHeight, ...logoProps } = logoLight; @@ -46,6 +46,7 @@ export default async function RootLayout({ + ); } diff --git a/apps/engineeringblog/content/site/settings.mdx b/apps/engineeringblog/content/site/settings.mdx index 5c1950916..4611227ce 100644 --- a/apps/engineeringblog/content/site/settings.mdx +++ b/apps/engineeringblog/content/site/settings.mdx @@ -35,4 +35,6 @@ connect: url: https://www.instagram.com/code4africa__/ - platform: Github url: https://github.com/CodeForAfrica +analytics: + analyticsId: "G-TN1WGZVHLE" --- diff --git a/apps/engineeringblog/lib/data/index.ts b/apps/engineeringblog/lib/data/index.ts index a7cbe5947..700d576b4 100644 --- a/apps/engineeringblog/lib/data/index.ts +++ b/apps/engineeringblog/lib/data/index.ts @@ -107,17 +107,23 @@ interface SecondaryNavigationProps extends NavigationProps { copyright: string; } +export type AnalyticsProps = { + analyticsId: string; +}; + type SettingsProps = { title: string; primaryNavigation: PrimaryNavigationProps; secondaryNavigation: SecondaryNavigationProps; connect: ConnectProps; + analytics: AnalyticsProps; }; async function readSettingsFile(filePath: string): Promise { const { data } = await readMdFile(filePath); return { + analytics: data.analytics, connect: data.connect, primaryNavigation: data.primaryNavigation, secondaryNavigation: data.secondaryNavigation, diff --git a/apps/engineeringblog/package.json b/apps/engineeringblog/package.json index aee33c4e8..dcc079364 100644 --- a/apps/engineeringblog/package.json +++ b/apps/engineeringblog/package.json @@ -22,6 +22,7 @@ "@mui/material-nextjs": "catalog:", "@mui/utils": "catalog:", "@next/mdx": "catalog:", + "@next/third-parties": "catalog:", "date-fns": "catalog:", "gray-matter": "catalog:", "@types/mdx": "catalog:", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c8fb23343..a956399cf 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -870,7 +870,7 @@ importers: version: 14.2.8 '@next/third-parties': specifier: 'catalog:' - version: 14.2.8(next@14.2.8(@babel/core@7.25.2)(@opentelemetry/api@1.9.0)(@playwright/test@1.46.1)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.69.4))(react@18.3.1) + version: 14.2.8(next@14.2.8(@opentelemetry/api@1.9.0)(@playwright/test@1.46.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.69.4))(react@18.3.1) '@payloadcms/bundler-webpack': specifier: 'catalog:' version: 1.0.7(@swc/core@1.7.23(@swc/helpers@0.5.5))(ajv@8.17.1)(payload@2.28.0(@swc/helpers@0.5.5)(@types/react@18.3.5)(encoding@0.1.13)(typescript@5.5.4)(webpack@5.93.0(@swc/core@1.7.23(@swc/helpers@0.5.5))))(sass@1.69.4) @@ -1498,6 +1498,9 @@ importers: '@next/mdx': specifier: 'catalog:' version: 14.2.8(@mdx-js/loader@3.0.1(webpack@5.93.0))(@mdx-js/react@3.0.1(@types/react@18.3.5)(react@18.3.1)) + '@next/third-parties': + specifier: 'catalog:' + version: 14.2.8(next@14.2.8(@opentelemetry/api@1.9.0)(@playwright/test@1.46.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.69.4))(react@18.3.1) '@types/mdx': specifier: 'catalog:' version: 2.0.13 @@ -2022,7 +2025,7 @@ importers: version: 14.2.8 '@next/third-parties': specifier: 'catalog:' - version: 14.2.8(next@14.2.8(@babel/core@7.25.2)(@opentelemetry/api@1.9.0)(@playwright/test@1.46.1)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.69.4))(react@18.3.1) + version: 14.2.8(next@14.2.8(@opentelemetry/api@1.9.0)(@playwright/test@1.46.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.69.4))(react@18.3.1) '@payloadcms/bundler-webpack': specifier: 'catalog:' version: 1.0.7(@swc/core@1.7.23(@swc/helpers@0.5.5))(ajv@8.17.1)(payload@2.28.0(@swc/helpers@0.5.5)(@types/react@18.3.5)(encoding@0.1.13)(typescript@5.5.4)(webpack@5.93.0(@swc/core@1.7.23(@swc/helpers@0.5.5))))(sass@1.69.4) @@ -17855,7 +17858,7 @@ snapshots: '@next/swc-win32-x64-msvc@14.2.8': optional: true - '@next/third-parties@14.2.8(next@14.2.8(@babel/core@7.25.2)(@opentelemetry/api@1.9.0)(@playwright/test@1.46.1)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.69.4))(react@18.3.1)': + '@next/third-parties@14.2.8(next@14.2.8(@opentelemetry/api@1.9.0)(@playwright/test@1.46.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.69.4))(react@18.3.1)': dependencies: next: 14.2.8(@babel/core@7.25.2)(@opentelemetry/api@1.9.0)(@playwright/test@1.46.1)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.69.4) react: 18.3.1