From 8cce2f588fbd06c5e2b39dfcdaffd06afa720e33 Mon Sep 17 00:00:00 2001 From: nearlysean Date: Tue, 25 Jun 2024 13:54:21 -0600 Subject: [PATCH 1/2] update dns from audit to assessment --- next.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/next.config.js b/next.config.js index 81f317d13..390ece453 100644 --- a/next.config.js +++ b/next.config.js @@ -89,7 +89,7 @@ const nextConfig = { permanent: false, }, { - source: '/auditrequest', + source: '/assessments', destination: 'https://airtable.com/appr1nBRRGx2PTJVh/shrpa99vKKW3xafso', permanent: false, }, From e89d3b8f590837cc89fa95aad0b7a40efb670bbb Mon Sep 17 00:00:00 2001 From: Charles Garrett Date: Wed, 26 Jun 2024 09:59:33 -0400 Subject: [PATCH 2/2] feat: toggle the github branch used for blog content based on the current environment --- src/pages/blog/[[...pages]].tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/pages/blog/[[...pages]].tsx b/src/pages/blog/[[...pages]].tsx index bb91dd325..0b5d62e63 100644 --- a/src/pages/blog/[[...pages]].tsx +++ b/src/pages/blog/[[...pages]].tsx @@ -10,17 +10,19 @@ import { recordHandledError } from '@/utils/analytics'; import type { NextPageWithLayout } from '@/utils/types'; export const getServerSideProps = (async ({ resolvedUrl }) => { + const isProd = ['https://near.org', 'https://dev.near.org'].some((url) => process.env.NEXT_PUBLIC_HOSTNAME === url); + const blog_branch = isProd ? 'main' : 'develop'; const blogParts = resolvedUrl.split('blog/'); let title = 'index.html'; if (blogParts[1] !== title) { title = `${blogParts[1].substring(0, blogParts[1].indexOf('/'))}/index.html`; } - const res = await fetch(`https://raw.githubusercontent.com/near/nearorg_marketing/main/public/blog/${title}`).catch( - (e) => { - recordHandledError({ title, message: 'failed to fetch github blog html for requested title' }); - throw e; - }, - ); + const res = await fetch( + `https://raw.githubusercontent.com/near/nearorg_marketing/${blog_branch}/public/blog/${title}`, + ).catch((e) => { + recordHandledError({ title, message: 'failed to fetch github blog html for requested title' }); + throw e; + }); const __html = await (await res.blob()).text();