Skip to content

Commit 9e65d5d

Browse files
authored
Add interactive docs to dev server (#14093)
Adds documentation for interactive pages, which can be rendered on dotcom, the live apps, and AMP.
1 parent 9fccf71 commit 9e65d5d

File tree

5 files changed

+24
-0
lines changed

5 files changed

+24
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { Available } from './available';
2+
3+
export const Interactive = () => (
4+
<>
5+
<Available targets={['dotcom', 'live apps', 'amp']} />
6+
<p>
7+
Interactives are actually a kind of <a href="../article">article</a>
8+
, but DCAR has a separate endpoint for them for performance reasons.
9+
You can find some examples on the{' '}
10+
<a href="https://www.theguardian.com/interactive">
11+
Interactives front
12+
</a>
13+
.
14+
</p>
15+
</>
16+
);
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import express from 'express';
22
import { Amp } from '../docs/amp';
33
import { Article } from '../docs/article';
4+
import { Interactive } from '../docs/interactive';
45
import { sendReact } from '../send';
56

67
const amp = express.Router();
78

89
amp.get('/', sendReact('AMP', Amp));
910
amp.get('/article', sendReact('Article', Article));
11+
amp.get('/interactive', sendReact('Interactive', Interactive));
1012

1113
export { amp };

dotcom-rendering/src/devServer/routers/dotcom.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Router } from 'express';
22
import { Article } from '../docs/article';
33
import { Dotcom } from '../docs/dotcom';
44
import { Front } from '../docs/front';
5+
import { Interactive } from '../docs/interactive';
56
import { TagPage } from '../docs/tagPage';
67
import { sendReact } from '../send';
78

@@ -11,5 +12,6 @@ dotcom.get('/', sendReact('Dotcom', Dotcom));
1112
dotcom.get('/article', sendReact('Article', Article));
1213
dotcom.get('/front', sendReact('Front', Front));
1314
dotcom.get('/tag-page', sendReact('Tag Page', TagPage));
15+
dotcom.get('/interactive', sendReact('Interactive', Interactive));
1416

1517
export { dotcom };
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import express from 'express';
22
import { Article } from '../docs/article';
3+
import { Interactive } from '../docs/interactive';
34
import { LiveApps } from '../docs/liveApps';
45
import { sendReact } from '../send';
56

67
const liveApps = express.Router();
78

89
liveApps.get('/', sendReact('Live Apps', LiveApps));
910
liveApps.get('/article', sendReact('Article', Article));
11+
liveApps.get('/interactive', sendReact('Interactive', Interactive));
1012

1113
export { liveApps };

dotcom-rendering/src/devServer/routers/pages.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Router } from 'express';
22
import { Article } from '../docs/article';
33
import { Front } from '../docs/front';
4+
import { Interactive } from '../docs/interactive';
45
import { Pages } from '../docs/pages';
56
import { TagPage } from '../docs/tagPage';
67
import { sendReact } from '../send';
@@ -11,5 +12,6 @@ pages.get('/', sendReact('Pages', Pages));
1112
pages.get('/article', sendReact('Article', Article));
1213
pages.get('/front', sendReact('Front', Front));
1314
pages.get('/tag-page', sendReact('Tag Page', TagPage));
15+
pages.get('/interactive', sendReact('Interactive', Interactive));
1416

1517
export { pages };

0 commit comments

Comments
 (0)