Skip to content

Commit 8bfa518

Browse files
authored
Prepare domain switch for Changelog (#9152)
* Prepare domain switch for Changelog * fix build * Don't do it for preview envs * fix undefined assetPrefix * fix config * fix build
1 parent 2ee08c4 commit 8bfa518

File tree

5 files changed

+26
-19
lines changed

5 files changed

+26
-19
lines changed

app/changelog/globals.css

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
@tailwind components;
55
@tailwind utilities;
66

7+
8+
#changelogcontent {
9+
font-family: var(--font-rubik);
10+
}
711
.radix-themes {
812
--cursor-button: pointer;
913
}

app/changelog/header.tsx

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
import Image from 'next/image';
2-
31
export default function Header({loading}) {
42
return (
53
<div className="w-full mx-auto h-96 relative bg-darkPurple">
64
<div className="relative w-full lg:max-w-7xl mx-auto px-4 lg:px-8 pt-8 grid grid-cols-12 items-center">
7-
<Image
5+
<img
86
className={`justify-self-center col-span-10 z-20 hidden lg:block ${loading ? 'animate-fade-in-left' : ''}`}
9-
src="/changelog/assets/hero.png"
7+
src="https://docs.sentry.io/changelog/assets/hero.png"
108
alt="Sentry Changelog"
119
height={273}
1210
width={450}

app/changelog/layout.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const rubik = Rubik({
1313
weight: ['400', '500', '700'],
1414
style: ['normal', 'italic'],
1515
subsets: ['latin'],
16+
variable: '--font-rubik',
1617
});
1718

1819
export const metadata: Metadata = {
@@ -23,7 +24,7 @@ export default function ChangelogLayout({children}: {children: ReactNode}) {
2324
return (
2425
<Theme accentColor="violet" grayColor="sand" radius="large" scaling="95%">
2526
<NextTopLoader color="#8d5494" />
26-
<div className={`${rubik.className}`}>
27+
<div id="changelogcontent" className={`${rubik.variable}`}>
2728
<Navbar />
2829
<div className="bg-gray-100">{children}</div>
2930
<div className="w-full mx-auto h-16 relative bg-darkPurple">

next.config.js

+13-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
11
const createMDX = require('@next/mdx');
22
const remarkPrism = require('remark-prism');
33

4+
const isProd = process.env.NODE_ENV === 'production' && !process.env.IS_PREVIEW;
5+
46
/** @type {import('next').NextConfig} */
57
const nextConfig = {
8+
headers() {
9+
return [
10+
{
11+
source: '/_next/static/([^/]+/pages|chunks|runtime|css|fonts|media)/(.+)',
12+
headers: [{key: 'Access-Control-Allow-Origin', value: '*'}],
13+
},
14+
];
15+
},
16+
assetPrefix: isProd ? 'https://docs.sentry.io' : undefined,
17+
618
pageExtensions: ['js', 'jsx', 'mdx', 'ts', 'tsx'],
719

820
images: {
@@ -3145,7 +3157,7 @@ module.exports = withSentryConfig(
31453157
// Suppresses source map uploading logs during build
31463158
silent: true,
31473159
org: 'sentry',
3148-
project: 'sentry-docs-nextjs',
3160+
project: 'docs',
31493161
},
31503162
{
31513163
// For all available options, see:
@@ -3157,9 +3169,6 @@ module.exports = withSentryConfig(
31573169
// Transpiles SDK to be compatible with IE11 (increases bundle size)
31583170
transpileClientSDK: true,
31593171

3160-
// Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers (increases server load)
3161-
tunnelRoute: '/monitoring',
3162-
31633172
// Hides source maps from generated client bundles
31643173
hideSourceMaps: true,
31653174

src/components/changelog/article.tsx

+5-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {ReactNode} from 'react';
2-
import Image from 'next/image';
32

43
import Date from './date';
54
import Tag from './tag';
@@ -31,15 +30,11 @@ export default function Article({
3130
return (
3231
<article className={`bg-white rounded-lg shadow-lg mb-8 ${className}`}>
3332
{image && (
34-
<div className="relative w-full h-64">
35-
<Image
36-
className="object-cover rounded-lg rounded-b-none"
37-
src={image}
38-
fill
39-
alt={title}
40-
sizes="(max-width: 768px) 100vw"
41-
/>
42-
</div>
33+
<img
34+
className="object-cover relative w-full h-64 rounded-lg rounded-b-none"
35+
src={image}
36+
alt={title}
37+
/>
4338
)}
4439
<div className="p-6">
4540
<h3 className="text-3xl text-primary font-semibold mb-2">{title}</h3>

0 commit comments

Comments
 (0)