Skip to content

Commit 2384c36

Browse files
authored
chore(storefront): metadata and blog image fixes (#2332)
sets the `metadataBase` so it is not always using localhost. fixes width on blog header images
1 parent c25b798 commit 2384c36

File tree

3 files changed

+22
-7
lines changed

3 files changed

+22
-7
lines changed

apps/storefront/app/bloggen/_components/PostLayout/PostLayout.module.css

+11-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
}
1313

1414
.intro {
15+
width: 100%;
1516
max-width: 720px;
1617
display: flex;
1718
flex-wrap: wrap;
@@ -57,12 +58,21 @@
5758

5859
.content img {
5960
display: block;
60-
width: 860px !important;
61+
width: 860px;
6162
margin: var(--ds-spacing-12) 0;
6263
margin-left: calc((100% - 860px) / 2) !important;
6364
background-color: var(--ds-color-neutral-background-subtle);
6465
}
6566

67+
.main > figure {
68+
margin: auto;
69+
width: 100%;
70+
}
71+
72+
.main > figure img {
73+
width: 100%;
74+
}
75+
6676
.content:last-child {
6777
margin-bottom: var(--ds-spacing-12);
6878
}

apps/storefront/app/bloggen/_components/PostLayout/PostLayout.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ function PostLayout({
6161
<span>{author}</span>
6262
</Paragraph>
6363
</div>
64+
<Image
65+
src={imageSrc}
66+
alt={imageAlt}
67+
caption={imageCaption}
68+
boxShadow={false}
69+
/>
6470
<MdxContent classname={classes.content}>
65-
<Image
66-
src={imageSrc}
67-
alt={imageAlt}
68-
caption={imageCaption}
69-
boxShadow={false}
70-
/>
7171
{content}
7272
<div className={classes.wantToWrite}>
7373
<Heading level={3} size='xs'>

apps/storefront/app/layout.tsx

+5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ import type { Metadata } from 'next';
99
import { Footer } from '../components/Footer/Footer';
1010

1111
export const metadata: Metadata = {
12+
metadataBase: new URL(
13+
process.env.VERCEL_GIT_COMMIT_REF !== 'main'
14+
? 'https://next.designsystemet.no'
15+
: 'https://designsystemet.no',
16+
),
1217
title: {
1318
template: '%s - Designsystemet',
1419
default: 'Designsystemet',

0 commit comments

Comments
 (0)