Skip to content

Commit 0d76494

Browse files
authored
Add tag page docs to dev server (#14092)
Adds documentation for tag pages, which can be rendered on dotcom only.
1 parent 5b6c627 commit 0d76494

File tree

3 files changed

+109
-0
lines changed

3 files changed

+109
-0
lines changed
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
import { Available } from './available';
2+
3+
const Examples = () => (
4+
<>
5+
<h2>Examples</h2>
6+
<dl>
7+
<dt>
8+
<a href="https://www.theguardian.com/tone/minutebyminute">
9+
Minute-by-minute tone
10+
</a>
11+
</dt>
12+
<dd>
13+
The tag page for the minute-by-minute tone tag, which is applied
14+
to all liveblogs and deadblogs.
15+
</dd>
16+
<dt>
17+
<a href="https://www.theguardian.com/profile/katharineviner">
18+
Katharine Viner's profile
19+
</a>
20+
</dt>
21+
<dd>
22+
The tag page for Katharine Viner's contributor tag, also known
23+
as a profile page. Demonstrates that a tag page can contain a
24+
bio (or description) derived from the tag's metadata.
25+
</dd>
26+
<dt>
27+
<a href="https://www.theguardian.com/environment/series/the-age-of-extinction/all">
28+
The age of extinction series
29+
</a>
30+
</dt>
31+
<dd>
32+
The tag page for the age of extinction series tag, which is
33+
applied to all content that's part of that series. This is an
34+
example of a tag page that's been upgraded to a front, so the
35+
tag page has been retrieved by appending <code>/all</code>. This
36+
also demonstrates the existence of "branding" that can be added
37+
to a tag page in the form of a badge.
38+
</dd>
39+
</dl>
40+
</>
41+
);
42+
43+
const IndexesOfTags = () => (
44+
<>
45+
<h2>Indexes of Tags</h2>
46+
<p>
47+
These are not tag pages themselves, but rather indexes of tags that
48+
link to a variety of different tag pages.
49+
</p>
50+
<ul>
51+
<li>
52+
<a href="https://www.theguardian.com/index/subjects">
53+
An index of subjects
54+
</a>
55+
</li>
56+
<li>
57+
<a href="https://www.theguardian.com/index/contributors">
58+
An index of contributors
59+
</a>
60+
</li>
61+
</ul>
62+
</>
63+
);
64+
65+
const SeeAlso = () => (
66+
<>
67+
<h2>See also</h2>
68+
<ul>
69+
<li>
70+
<a href="../front">Front</a>
71+
</li>
72+
</ul>
73+
</>
74+
);
75+
76+
export const TagPage = () => (
77+
<>
78+
<Available targets={['dotcom']} />
79+
<p>
80+
Tag pages are automatically generated, reverse chronological lists
81+
of articles published with a particular tag. They are sometimes
82+
"upgraded" into a front, a curated collection of content. When this
83+
happens on dotcom it's usually possible to view the original tag
84+
page by appending <code>/all</code> to the path. For example:
85+
<pre>
86+
<a href="https://www.theguardian.com/environment/climate-crisis">
87+
https://www.theguardian.com/environment/climate-crisis
88+
</a>
89+
</pre>
90+
is a front that has replaced the{' '}
91+
<code>environment/climate-crisis</code> tag page, and the original
92+
tag page can now be viewed at:
93+
<pre>
94+
<a href="https://www.theguardian.com/environment/climate-crisis/all">
95+
https://www.theguardian.com/environment/climate-crisis/all
96+
</a>
97+
</pre>
98+
It is also possible to view both the front and the tag page within
99+
the live apps, although neither are rendered by DCAR there.
100+
</p>
101+
<Examples />
102+
<IndexesOfTags />
103+
<SeeAlso />
104+
</>
105+
);

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

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

78
const dotcom = Router();
89

910
dotcom.get('/', sendReact('Dotcom', Dotcom));
1011
dotcom.get('/article', sendReact('Article', Article));
1112
dotcom.get('/front', sendReact('Front', Front));
13+
dotcom.get('/tag-page', sendReact('Tag Page', TagPage));
1214

1315
export { dotcom };

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ import { Router } from 'express';
22
import { Article } from '../docs/article';
33
import { Front } from '../docs/front';
44
import { Pages } from '../docs/pages';
5+
import { TagPage } from '../docs/tagPage';
56
import { sendReact } from '../send';
67

78
const pages = Router();
89

910
pages.get('/', sendReact('Pages', Pages));
1011
pages.get('/article', sendReact('Article', Article));
1112
pages.get('/front', sendReact('Front', Front));
13+
pages.get('/tag-page', sendReact('Tag Page', TagPage));
1214

1315
export { pages };

0 commit comments

Comments
 (0)