Skip to content

Commit cc88352

Browse files
authored
Merge pull request #14301 from guardian/ravi/dev-server-page-remove-amp
Dev server page - remove AMP and tidy up
2 parents 3253ff9 + e135458 commit cc88352

File tree

1 file changed

+37
-96
lines changed

1 file changed

+37
-96
lines changed

dotcom-rendering/src/server/dev-index.html

Lines changed: 37 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -20,94 +20,70 @@
2020
}
2121
.test-articles-list span {
2222
display: inline-block;
23-
width: 8em;
2423
line-height: 2em;
24+
margin-right: 2em;
2525
}
26-
.test-article-header span {
27-
font-weight: bold;
28-
}
29-
.test-article > span:nth-child(1),
30-
.test-article-header > span:nth-child(1) {
26+
.test-article > span:nth-child(1) {
3127
width: 14em !important;
3228
}
3329
</style>
3430
</head>
3531
<body>
36-
<h2>Default Endpoints</h2>
37-
38-
<form name="url-form">
39-
<input
40-
type="url"
41-
name="url-input"
42-
size="100"
43-
required
44-
placeholder="https://www.theguardian.com/money/2017/mar/10/ministers-to-criminalise-use-of-ticket-tout-harvesting-software"
45-
/>
46-
<input type="submit" value="Add" />
47-
</form>
32+
<h2>Pages</h2>
4833

4934
<ul id="default-endpoints">
5035
<li>
5136
<a
52-
href="/Article/https://www.theguardian.com/money/2017/mar/10/ministers-to-criminalise-use-of-ticket-tout-harvesting-software"
53-
>Article</a
54-
>
55-
</li>
56-
<li>
57-
<a
58-
href="/AMPArticle/https://amp.theguardian.com/world/2013/jun/09/edward-snowden-nsa-whistleblower-surveillance"
59-
>⚡️Article</a
37+
href="/Article/https://www.theguardian.com/travel/2024/apr/03/walking-londons-unsung-river-nature-culture-and-moments-of-wonder-along-the-river-lea"
38+
>🌍 Article</a
6039
>
6140
</li>
6241
<li>
6342
<a
64-
href="/Interactive/https://www.theguardian.com/global-development/ng-interactive/2022/jun/09/the-black-sea-blockade-mapping-the-impact-of-war-in-ukraine-on-the-worlds-food-supply-interactive"
65-
>Interactive</a
43+
href="/AppsArticle/https://www.theguardian.com/travel/2024/apr/03/walking-londons-unsung-river-nature-culture-and-moments-of-wonder-along-the-river-lea"
44+
>📱 Apps Article</a
6645
>
6746
</li>
6847
<li>
69-
<a
70-
href="/AMPInteractive/https://www.theguardian.com/world/2021/mar/24/how-a-container-ship-blocked-the-suez-canal-visual-guide"
71-
>⚡️Interactive</a
48+
<a href="/Front/https://www.theguardian.com/international"
49+
>🖼️ Front</a
7250
>
7351
</li>
7452
<li>
7553
<a
76-
href="/AppsInteractive/https://www.theguardian.com/global-development/ng-interactive/2022/jun/09/the-black-sea-blockade-mapping-the-impact-of-war-in-ukraine-on-the-worlds-food-supply-interactive"
77-
>Apps Interactive</a
78-
>
79-
</li>
80-
<li>
81-
<a href="/Front/https://www.theguardian.com/international"
82-
>International Front</a
54+
href="/TagPage/https://www.theguardian.com/tone/minutebyminute"
55+
>🏷️ Tag Page</a
8356
>
84-
(<a href="/FrontJSON/https://www.theguardian.com/international"
85-
>Enhanced JSON</a
86-
>)
8757
</li>
8858
<li>
8959
<a
90-
href="/TagPage/https://www.theguardian.com/tone/minutebyminute"
91-
>Tag Page</a
60+
href="/Interactive/https://www.theguardian.com/global-development/ng-interactive/2022/jun/09/the-black-sea-blockade-mapping-the-impact-of-war-in-ukraine-on-the-worlds-food-supply-interactive"
61+
>✨ Interactive</a
9262
>
93-
(<a
94-
href="/FrontJSON/https://www.theguardian.com/tone/minutebyminute"
95-
>Enhanced JSON</a
96-
>)
9763
</li>
9864
<li>
9965
<a
100-
href="/AppsArticle/https://www.theguardian.com/money/2017/mar/10/ministers-to-criminalise-use-of-ticket-tout-harvesting-software"
101-
>📱 Apps Article</a
66+
href="/AppsInteractive/https://www.theguardian.com/global-development/ng-interactive/2022/jun/09/the-black-sea-blockade-mapping-the-impact-of-war-in-ukraine-on-the-worlds-food-supply-interactive"
67+
>💫 Apps Interactive</a
10268
>
10369
</li>
10470
<li>
10571
<a
10672
href="/EmailNewsletters/https://api.nextgen.guardianapps.co.uk/email-newsletters"
107-
>📧 All Newsletters page</a
73+
>📧 Email Newsletters</a
10874
>
10975
</li>
11076
</ul>
77+
<form name="url-form">
78+
<input
79+
type="url"
80+
name="url-input"
81+
size="100"
82+
required
83+
placeholder="https://www.theguardian.com/money/2017/mar/10/ministers-to-criminalise-use-of-ticket-tout-harvesting-software"
84+
/>
85+
<input type="submit" value="Add" />
86+
</form>
11187

11288
<section>
11389
<h2>Article Examples</h2>
@@ -307,12 +283,9 @@ <h2>Article Examples</h2>
307283
<table>
308284
<thead>
309285
<tr>
310-
<th rowspan="2">Headline</th>
311-
<th rowspan="2">Description</th>
312-
<th rowspan="2">Format</th>
313-
<th colspan="3">Links</th>
314-
</tr>
315-
<tr>
286+
<th>Headline</th>
287+
<th>Description</th>
288+
<th>Format</th>
316289
<th>DEV</th>
317290
<th>CODE</th>
318291
<th>PROD</th>
@@ -341,23 +314,20 @@ <h2>Article Examples</h2>
341314
<td class="links">
342315
<article-link product="dotcom" env="DEV"></article-link>
343316
<article-link product="apps" env="DEV"></article-link>
344-
<article-link product="amp" env="DEV"></article-link>
345317
</td>
346318
<td class="links">
347319
<article-link
348320
product="dotcom"
349321
env="CODE"
350322
></article-link>
351323
<article-link product="apps" env="CODE"></article-link>
352-
<article-link product="amp" env="CODE"></article-link>
353324
</td>
354325
<td class="links">
355326
<article-link
356327
product="dotcom"
357328
env="PROD"
358329
></article-link>
359330
<article-link product="apps" env="PROD"></article-link>
360-
<article-link product="amp" env="PROD"></article-link>
361331
</td>
362332
</tr>
363333
</template>
@@ -401,27 +371,11 @@ <h2>Article Examples</h2>
401371

402372
<h2>Test Articles By Element</h2>
403373

404-
<div id="test-articles-by-element" class="test-articles-list">
405-
<div class="test-article-header">
406-
<span>type</span>
407-
<span>local</span>
408-
<span>local-amp</span>
409-
<span>production</span>
410-
<span>production-amp</span>
411-
</div>
412-
</div>
374+
<div id="test-articles-by-element" class="test-articles-list"></div>
413375

414376
<h2>Test Articles By Atom Type</h2>
415377

416-
<div id="test-articles-by-atom-type" class="test-articles-list">
417-
<div class="test-article-header">
418-
<span>type</span>
419-
<span>local</span>
420-
<span>local-amp</span>
421-
<span>production</span>
422-
<span>production-amp</span>
423-
</div>
424-
</div>
378+
<div id="test-articles-by-atom-type" class="test-articles-list"></div>
425379

426380
<h2>Test Articles By Element (Missing)</h2>
427381
<ul>
@@ -733,10 +687,9 @@ <h2>Test Articles By Element (Missing)</h2>
733687
const makeTestArticle = (a) => `
734688
<div class="test-article">
735689
<span>${a.name}</span>
736-
<span><a href="/Article/https://www.theguardian.com${a.article}">🔗</a> <a href="/Article/http://localhost:9000${a.article}">🔗(local FE)</a></span>
737-
<span><a href="/AMPArticle/https://www.theguardian.com${a.article}">🔗</a> <a href="/AMPArticle/http://localhost:9000${a.article}">🔗(local FE)</a></span>
738-
<span><a href="https://www.theguardian.com${a.article}">example</a></span>
739-
<span><a href="https://amp.theguardian.com${a.article}">example</a></span>
690+
<span><a href="/Article/https://www.theguardian.com${a.article}">local</a></span>
691+
<span><a href="/Article/http://localhost:9000${a.article}">local FE</a></span>
692+
<span><a href="https://www.theguardian.com${a.article}">prod</a></span>
740693
</div>
741694
`;
742695

@@ -916,7 +869,7 @@ <h2>${title}</h2>
916869

917870
class ArticleLink extends HTMLElement {
918871
/**
919-
* @typedef {'dotcom' | 'apps' | 'amp'} Product
872+
* @typedef {'dotcom' | 'apps'} Product
920873
* @typedef {'PROD' | 'CODE' | 'DEV'} Env
921874
*/
922875

@@ -938,8 +891,6 @@ <h2>${title}</h2>
938891
case 'dotcom':
939892
case 'apps':
940893
return 'https://www.theguardian.com';
941-
case 'amp':
942-
return 'https://amp.theguardian.com';
943894
}
944895
}
945896

@@ -952,8 +903,6 @@ <h2>${title}</h2>
952903
case 'dotcom':
953904
case 'apps':
954905
return 'https://m.code.dev-theguardian.com';
955-
case 'amp':
956-
return 'https://amp.code.dev-theguardian.com';
957906
}
958907
}
959908

@@ -977,8 +926,6 @@ <h2>${title}</h2>
977926
return '/Article';
978927
case 'apps':
979928
return '/AppsArticle';
980-
case 'amp':
981-
return '/AMPArticle';
982929
}
983930
}
984931

@@ -1027,8 +974,6 @@ <h2>${title}</h2>
1027974
return '🌍 Dotcom';
1028975
case 'apps':
1029976
return '📱 Apps';
1030-
case 'amp':
1031-
return '⚡️ AMP';
1032977
}
1033978
}
1034979

@@ -1081,13 +1026,9 @@ <h2>${title}</h2>
10811026
const env = this.getAttribute('env');
10821027
const href = this.getAttribute('href');
10831028

1084-
if (
1085-
product !== 'dotcom' &&
1086-
product !== 'apps' &&
1087-
product !== 'amp'
1088-
) {
1029+
if (product !== 'dotcom' && product !== 'apps') {
10891030
this.textContent =
1090-
"article-link error: 'product' must be one of: 'dotcom', 'apps' or 'amp'";
1031+
"article-link error: 'product' must be one of: 'dotcom' or 'apps'";
10911032
return;
10921033
}
10931034

0 commit comments

Comments
 (0)