Skip to content

Commit 9c23a75

Browse files
committed
share gallery onward trails
1 parent 4268ee7 commit 9c23a75

File tree

4 files changed

+161
-338
lines changed

4 files changed

+161
-338
lines changed
Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
import {
2+
ArticleDesign,
3+
ArticleDisplay,
4+
Pillar,
5+
} from '../../src/lib/articleFormat';
6+
import { getDataLinkNameCard } from '../../src/lib/getDataLinkName';
7+
import { type TrailType } from '../../src/types/trails';
8+
9+
export const galleryOnwardsTrails: TrailType[] = [
10+
{
11+
url: 'http://localhost:9000/environment/gallery/2025/aug/22/week-in-wildlife-a-clumsy-fox-swinging-orangutang-and-rescued-jaguarundi-cub',
12+
linkText:
13+
'Week in wildlife: a clumsy fox, a swinging orangutan and a rescued jaguarundi cub',
14+
showByline: false,
15+
byline: 'Pejman Faratin',
16+
image: {
17+
src: 'https://media.guim.co.uk/a81e974ffee6c8c88fa280c2d02eaf5dc2af863e/151_292_1020_816/master/1020.jpg',
18+
altText: '',
19+
},
20+
format: {
21+
theme: Pillar.News,
22+
design: ArticleDesign.Gallery,
23+
display: ArticleDisplay.Standard,
24+
},
25+
webPublicationDate: '2022-01-01T06:00:25.000Z',
26+
headline:
27+
'Week in wildlife: a clumsy fox, a swinging orangutan and a rescued jaguarundi cub',
28+
shortUrl: 'https://www.theguardian.com/p/x32n89',
29+
discussion: {
30+
isCommentable: false,
31+
isClosedForComments: true,
32+
discussionId: '/p/x32n89',
33+
},
34+
discussionId: 'zHoBy6HNKsk',
35+
dataLinkName: getDataLinkNameCard(
36+
{
37+
theme: Pillar.News,
38+
design: ArticleDesign.Gallery,
39+
display: ArticleDisplay.Standard,
40+
},
41+
'0',
42+
0,
43+
),
44+
trailText:
45+
'Guinness World Records is looking back at the extraordinary feats achieved since its inception - as well as unveiling 70 whacky and unclaimed records ',
46+
kickerText: 'Politics', // Get data for this
47+
mainMedia: { type: 'Gallery', count: '6' },
48+
},
49+
{
50+
url: 'http://localhost:9000/money/gallery/2025/aug/22/characterful-cottages-for-sale-in-england-in-pictures',
51+
linkText: 'Characterful cottages for sale in England – in pictures',
52+
showByline: false,
53+
byline: 'Anna White',
54+
image: {
55+
src: 'https://media.guim.co.uk/58cd9356e6d68e8efa6028162bb959f9798307d5/515_0_5000_4000/master/5000.jpg',
56+
altText: '',
57+
},
58+
format: {
59+
design: ArticleDesign.Gallery,
60+
theme: Pillar.Lifestyle,
61+
display: ArticleDisplay.Standard,
62+
},
63+
webPublicationDate: '2022-01-01T06:00:24.000Z',
64+
headline: 'Characterful cottages for sale in England – in pictures',
65+
shortUrl: 'https://www.theguardian.com/p/x32gqj',
66+
discussion: {
67+
isCommentable: false,
68+
isClosedForComments: true,
69+
discussionId: '/p/x32gqj',
70+
},
71+
dataLinkName: getDataLinkNameCard(
72+
{
73+
design: ArticleDesign.Gallery,
74+
theme: Pillar.Lifestyle,
75+
display: ArticleDisplay.Standard,
76+
},
77+
'0',
78+
1,
79+
),
80+
trailText:
81+
'Picked from a record 60,636 entries, the first images from the Natural History Museum’s wildlife photographer of the year competition have been released. The photographs, which range from a lion facing down a cobra to magnified mould spores, show the diversity, beauty and complexity of the natural world and humanity’s relationship with it',
82+
mainMedia: { type: 'Gallery', count: '6' },
83+
},
84+
{
85+
url: 'http://localhost:9000/news/gallery/2025/aug/22/sunsets-aid-parachutes-and-giant-pandas-photos-of-the-day-friday',
86+
linkText:
87+
'Sunsets, aid parachutes and giant pandas: photos of the day – Friday ',
88+
showByline: false,
89+
byline: 'Eithne Staunton',
90+
image: {
91+
src: 'https://media.guim.co.uk/4ce0b080206fe9b65b976c1acf219d81072cc814/0_0_2113_1690/master/2113.png',
92+
altText: '',
93+
},
94+
format: {
95+
design: ArticleDesign.Gallery,
96+
theme: Pillar.News,
97+
display: ArticleDisplay.Standard,
98+
},
99+
webPublicationDate: '2022-01-01T08:49:42.000Z',
100+
headline:
101+
'Sunsets, aid parachutes and giant pandas: photos of the day – Friday ',
102+
shortUrl: 'https://www.theguardian.com/p/x3359z',
103+
discussion: {
104+
isCommentable: false,
105+
isClosedForComments: true,
106+
discussionId: '/p/x3359z',
107+
},
108+
dataLinkName: getDataLinkNameCard(
109+
{
110+
design: ArticleDesign.Gallery,
111+
theme: Pillar.News,
112+
display: ArticleDisplay.Standard,
113+
},
114+
'0',
115+
2,
116+
),
117+
trailText:
118+
'From the mock-Tudor fad of the 1920s to drivers refuelling on a roundabout, each era produces its own distinctive petrol stations – as photographer Philip Butler discovered',
119+
mainMedia: { type: 'Gallery', count: '6' },
120+
},
121+
{
122+
url: 'http://localhost:9000/fashion/gallery/2025/aug/22/what-to-wear-to-notting-hill-carnival',
123+
linkText: 'On parade: what to wear to Notting Hill carnival',
124+
showByline: false,
125+
byline: 'Melanie Wilkinson',
126+
image: {
127+
src: 'https://media.guim.co.uk/49a9656cd10c4f64f8bdd54380afb915c7a3648b/207_0_1500_1200/master/1500.jpg',
128+
altText: '',
129+
},
130+
format: {
131+
design: ArticleDesign.Gallery,
132+
theme: Pillar.Lifestyle,
133+
display: ArticleDisplay.Standard,
134+
},
135+
webPublicationDate: '2022-08-22T05:00:23.000Z',
136+
headline: 'On parade: what to wear to Notting Hill carnival',
137+
shortUrl: 'https://www.theguardian.com/p/x32mte',
138+
discussion: {
139+
isCommentable: false,
140+
isClosedForComments: true,
141+
discussionId: '/p/x32mte',
142+
},
143+
dataLinkName: getDataLinkNameCard(
144+
{
145+
design: ArticleDesign.Gallery,
146+
theme: Pillar.Lifestyle,
147+
display: ArticleDisplay.Standard,
148+
},
149+
'0',
150+
1,
151+
),
152+
trailText:
153+
'The Guardian’s picture editors select photographs from around the world',
154+
mainMedia: { type: 'Gallery', count: '6' },
155+
},
156+
];

dotcom-rendering/src/components/Card/Card.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ export type Position = 'inner' | 'outer' | 'none';
7979
export type Props = {
8080
linkTo: string;
8181
format: ArticleFormat;
82+
/** The format of the article holding the card */
8283
contextFormat?: ArticleFormat;
8384
serverTime?: number;
8485
headlineText: string;
Lines changed: 2 additions & 187 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import type { Meta, StoryObj } from '@storybook/react-webpack5';
2-
import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/articleFormat';
3-
import { getDataLinkNameCard } from '../lib/getDataLinkName';
2+
import { galleryOnwardsTrails } from '../../fixtures/manual/onwardsTrails';
43
import { MoreGalleries as MoreGalleriesComponent } from './MoreGalleries';
54

65
const meta = {
@@ -16,190 +15,6 @@ export const MoreGalleries = {
1615
args: {
1716
discussionApiUrl: 'https://discussion.theguardian.com/discussion-api',
1817
guardianBaseUrl: 'https://www.theguardian.com',
19-
trails: [
20-
{
21-
url: 'https://www.theguardian.com/environment/gallery/2025/aug/22/week-in-wildlife-a-clumsy-fox-swinging-orangutang-and-rescued-jaguarundi-cub',
22-
linkText:
23-
'Week in wildlife: a clumsy fox, a swinging orangutan and a rescued jaguarundi cub',
24-
showByline: false,
25-
byline: 'Pejman Faratin',
26-
image: {
27-
src: 'https://media.guim.co.uk/a81e974ffee6c8c88fa280c2d02eaf5dc2af863e/151_292_1020_816/master/1020.jpg',
28-
altText: '',
29-
},
30-
format: {
31-
theme: Pillar.News,
32-
design: ArticleDesign.Gallery,
33-
display: ArticleDisplay.Standard,
34-
},
35-
webPublicationDate: '2025-08-22T06:00:25.000Z',
36-
headline:
37-
'Week in wildlife: a clumsy fox, a swinging orangutan and a rescued jaguarundi cub',
38-
shortUrl: 'https://www.theguardian.com/p/x32n89',
39-
discussion: {
40-
isCommentable: false,
41-
isClosedForComments: true,
42-
discussionId: '/p/x32n89',
43-
},
44-
dataLinkName: getDataLinkNameCard(
45-
{
46-
theme: Pillar.News,
47-
design: ArticleDesign.Gallery,
48-
display: ArticleDisplay.Standard,
49-
},
50-
'0',
51-
0,
52-
),
53-
trailText:
54-
'Guinness World Records is looking back at the extraordinary feats achieved since its inception - as well as unveiling 70 whacky and unclaimed records ',
55-
kickerText: 'Politics',
56-
mainMedia: { type: 'Gallery', count: '6' },
57-
},
58-
{
59-
url: 'https://www.theguardian.com/money/gallery/2025/aug/22/characterful-cottages-for-sale-in-england-in-pictures',
60-
linkText:
61-
'Characterful cottages for sale in England – in pictures',
62-
showByline: false,
63-
byline: 'Anna White',
64-
image: {
65-
src: 'https://media.guim.co.uk/58cd9356e6d68e8efa6028162bb959f9798307d5/515_0_5000_4000/master/5000.jpg',
66-
altText: '',
67-
},
68-
format: {
69-
design: ArticleDesign.Gallery,
70-
theme: Pillar.Lifestyle,
71-
display: ArticleDisplay.Standard,
72-
},
73-
webPublicationDate: '2025-08-22T06:00:24.000Z',
74-
headline:
75-
'Characterful cottages for sale in England – in pictures',
76-
shortUrl: 'https://www.theguardian.com/p/x32gqj',
77-
discussion: {
78-
isCommentable: false,
79-
isClosedForComments: true,
80-
discussionId: '/p/x32gqj',
81-
},
82-
dataLinkName: getDataLinkNameCard(
83-
{
84-
design: ArticleDesign.Gallery,
85-
theme: Pillar.Lifestyle,
86-
display: ArticleDisplay.Standard,
87-
},
88-
'0',
89-
1,
90-
),
91-
trailText:
92-
'Picked from a record 60,636 entries, the first images from the Natural History Museum’s wildlife photographer of the year competition have been released. The photographs, which range from a lion facing down a cobra to magnified mould spores, show the diversity, beauty and complexity of the natural world and humanity’s relationship with it',
93-
mainMedia: { type: 'Gallery', count: '6' },
94-
},
95-
{
96-
url: 'https://www.theguardian.com/news/gallery/2025/aug/22/sunsets-aid-parachutes-and-giant-pandas-photos-of-the-day-friday',
97-
linkText:
98-
'Sunsets, aid parachutes and giant pandas: photos of the day – Friday ',
99-
showByline: false,
100-
byline: 'Eithne Staunton',
101-
image: {
102-
src: 'https://media.guim.co.uk/4ce0b080206fe9b65b976c1acf219d81072cc814/0_0_2113_1690/master/2113.png',
103-
altText: '',
104-
},
105-
format: {
106-
design: ArticleDesign.Gallery,
107-
theme: Pillar.News,
108-
display: ArticleDisplay.Standard,
109-
},
110-
webPublicationDate: '2025-08-22T12:49:42.000Z',
111-
headline:
112-
'Sunsets, aid parachutes and giant pandas: photos of the day – Friday ',
113-
shortUrl: 'https://www.theguardian.com/p/x3359z',
114-
discussion: {
115-
isCommentable: false,
116-
isClosedForComments: true,
117-
discussionId: '/p/x3359z',
118-
},
119-
dataLinkName: getDataLinkNameCard(
120-
{
121-
design: ArticleDesign.Gallery,
122-
theme: Pillar.News,
123-
display: ArticleDisplay.Standard,
124-
},
125-
'0',
126-
2,
127-
),
128-
trailText:
129-
'From the mock-Tudor fad of the 1920s to drivers refuelling on a roundabout, each era produces its own distinctive petrol stations – as photographer Philip Butler discovered',
130-
mainMedia: { type: 'Gallery', count: '6' },
131-
},
132-
{
133-
url: 'https://www.theguardian.com/fashion/gallery/2025/aug/22/what-to-wear-to-notting-hill-carnival',
134-
linkText: 'On parade: what to wear to Notting Hill carnival',
135-
showByline: false,
136-
byline: 'Melanie Wilkinson',
137-
image: {
138-
src: 'https://media.guim.co.uk/49a9656cd10c4f64f8bdd54380afb915c7a3648b/207_0_1500_1200/master/1500.jpg',
139-
altText: '',
140-
},
141-
format: {
142-
design: ArticleDesign.Gallery,
143-
theme: Pillar.Lifestyle,
144-
display: ArticleDisplay.Standard,
145-
},
146-
webPublicationDate: '2025-08-22T05:00:23.000Z',
147-
headline: 'On parade: what to wear to Notting Hill carnival',
148-
shortUrl: 'https://www.theguardian.com/p/x32mte',
149-
discussion: {
150-
isCommentable: false,
151-
isClosedForComments: true,
152-
discussionId: '/p/x32mte',
153-
},
154-
dataLinkName: getDataLinkNameCard(
155-
{
156-
design: ArticleDesign.Gallery,
157-
theme: Pillar.Lifestyle,
158-
display: ArticleDisplay.Standard,
159-
},
160-
'0',
161-
1,
162-
),
163-
trailText:
164-
'The Guardian’s picture editors select photographs from around the world',
165-
mainMedia: { type: 'Gallery', count: '6' },
166-
},
167-
{
168-
url: 'https://www.theguardian.com/artanddesign/gallery/2025/aug/21/psychedelic-rock-glass-mountain-michael-lundgren',
169-
linkText:
170-
'Psychedelic rock! Formations that mess with your mind – in pictures ',
171-
showByline: false,
172-
image: {
173-
src: 'https://media.guim.co.uk/2810af61b2d2d2d5f71ec01e56e6555e0a6d4635/55_0_2813_2250/master/2813.jpg',
174-
altText: '',
175-
},
176-
format: {
177-
design: ArticleDesign.Gallery,
178-
theme: Pillar.Culture,
179-
display: ArticleDisplay.Standard,
180-
},
181-
webPublicationDate: '2025-08-21T06:01:01.000Z',
182-
headline:
183-
'Psychedelic rock! Formations that mess with your mind – in pictures ',
184-
shortUrl: 'https://www.theguardian.com/p/x2p663',
185-
discussion: {
186-
isCommentable: false,
187-
isClosedForComments: true,
188-
discussionId: '/p/x2p663',
189-
},
190-
dataLinkName: getDataLinkNameCard(
191-
{
192-
design: ArticleDesign.Gallery,
193-
theme: Pillar.Culture,
194-
display: ArticleDisplay.Standard,
195-
},
196-
'0',
197-
1,
198-
),
199-
trailText:
200-
'Politicians and their partners put on their best show at this year’s Midwinter Ball, an annual dinner hosted by the Federal Parliamentary Press Gallery in Canberra',
201-
mainMedia: { type: 'Gallery', count: '6' },
202-
},
203-
],
18+
trails: galleryOnwardsTrails,
20419
},
20520
} satisfies Story;

0 commit comments

Comments
 (0)