@mindful-web/marko-web-digital-edition 1.95.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +1 -0
- package/LICENSE +21 -0
- package/README.md +121 -0
- package/components/ad.marko +81 -0
- package/components/ad.marko.js +102 -0
- package/components/article-body.marko +134 -0
- package/components/article-body.marko.js +186 -0
- package/components/author.marko +30 -0
- package/components/author.marko.js +59 -0
- package/components/gate.marko +158 -0
- package/components/gate.marko.js +147 -0
- package/components/ld-json.marko +5 -0
- package/components/ld-json.marko.js +29 -0
- package/components/marko.json +78 -0
- package/components/reflow.marko +67 -0
- package/components/reflow.marko.js +106 -0
- package/components/replica.marko +86 -0
- package/components/replica.marko.js +128 -0
- package/components/scroll.marko +134 -0
- package/components/scroll.marko.js +23 -0
- package/components/theme.marko +73 -0
- package/components/theme.marko.js +30 -0
- package/components/toc.marko +28 -0
- package/components/toc.marko.js +53 -0
- package/components/toolbar.marko +47 -0
- package/components/toolbar.marko.js +54 -0
- package/components/tracking.marko +211 -0
- package/components/tracking.marko.js +60 -0
- package/lib/authors.js +125 -0
- package/lib/entities.js +97 -0
- package/lib/index.js +453 -0
- package/marko.json +6 -0
- package/package.json +33 -0
- package/routes/index.js +129 -0
- package/scss/index.scss +679 -0
- package/templates/article.marko +108 -0
- package/templates/article.marko.js +238 -0
- package/templates/hub.marko +94 -0
- package/templates/hub.marko.js +219 -0
- package/templates/partial.marko +17 -0
- package/templates/partial.marko.js +44 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { editionPath, buildArticleLdJson, isIndexable } from "../lib";
|
|
2
|
+
|
|
3
|
+
$ const { requestOrigin, document, site } = out.global;
|
|
4
|
+
$ const {
|
|
5
|
+
manifest, item, canonicalUrl, prev, next, position, total, toc,
|
|
6
|
+
} = data;
|
|
7
|
+
|
|
8
|
+
$ const type = "digital-edition-article";
|
|
9
|
+
$ // The page title component appends the site name itself; adding the publication
|
|
10
|
+
$ // here doubled it ("… | Athletic Business | Athletic Business").
|
|
11
|
+
$ const title = item.headline || manifest.name;
|
|
12
|
+
$ const description = item.deck || `From the ${manifest.name} issue of ${manifest.publication}.`;
|
|
13
|
+
$ const hubPath = editionPath(manifest.issueId);
|
|
14
|
+
$ // Site-wide review hold (the site-config key named by the routes factory's
|
|
15
|
+
$ // `noIndexKey`) or a per-article hold from the ingest — either keeps the page out
|
|
16
|
+
$ // of search.
|
|
17
|
+
$ const { noIndexKey } = (out.global.digitalEdition || {});
|
|
18
|
+
$ const noIndex = Boolean(noIndexKey && site.get(noIndexKey)) || !isIndexable(item);
|
|
19
|
+
|
|
20
|
+
<!--
|
|
21
|
+
A single article from the digital edition, server-rendered at its own URL.
|
|
22
|
+
|
|
23
|
+
This is the crawlable, citable unit — the hub's continuous-scroll reader appends the
|
|
24
|
+
very same markup, so what a reader sees and what a crawler indexes cannot diverge.
|
|
25
|
+
|
|
26
|
+
This renders the site document directly instead of through <theme-default-page>,
|
|
27
|
+
which is the same thing minus one input: the theme page does not forward `no-index`
|
|
28
|
+
to the metadata component, and an article the ingest has held from search (p78's
|
|
29
|
+
shattered extraction) must emit a robots noindex. The metadata component owns the
|
|
30
|
+
single canonical and robots tags — never hand-roll either here.
|
|
31
|
+
|
|
32
|
+
`canonical-url`: for an article matched to an existing web article it points there;
|
|
33
|
+
a print-exclusive article self-canonicalizes.
|
|
34
|
+
-->
|
|
35
|
+
<${document} image=manifest.coverImage>
|
|
36
|
+
<@head>
|
|
37
|
+
<marko-web-default-page-metadata
|
|
38
|
+
title=title
|
|
39
|
+
description=description
|
|
40
|
+
canonical-url=canonicalUrl
|
|
41
|
+
no-index=noIndex
|
|
42
|
+
/>
|
|
43
|
+
<marko-web-digital-edition-theme view="read" />
|
|
44
|
+
<marko-web-gtm-default-context|{ context }| type=type>
|
|
45
|
+
<marko-web-gtm-push data=context />
|
|
46
|
+
</marko-web-gtm-default-context>
|
|
47
|
+
</@head>
|
|
48
|
+
<@container>
|
|
49
|
+
<@page for=type>
|
|
50
|
+
<marko-web-page-wrapper>
|
|
51
|
+
<@section>
|
|
52
|
+
<div class="edition edition--article">
|
|
53
|
+
<marko-web-digital-edition-toolbar manifest=manifest view="read" />
|
|
54
|
+
|
|
55
|
+
<div class="edition-article-page">
|
|
56
|
+
<nav class="edition-article-page__breadcrumb">
|
|
57
|
+
<a href=hubPath>${manifest.publication} · ${manifest.name}</a>
|
|
58
|
+
<if(position)>
|
|
59
|
+
<span class="edition-article-page__position">${position} of ${total}</span>
|
|
60
|
+
</if>
|
|
61
|
+
</nav>
|
|
62
|
+
|
|
63
|
+
<marko-web-identity-x-access|context| enabled=true>
|
|
64
|
+
$ const canAccess = Boolean(context && context.canAccess);
|
|
65
|
+
|
|
66
|
+
<script type="application/ld+json">
|
|
67
|
+
$!{JSON.stringify(buildArticleLdJson({
|
|
68
|
+
manifest, item, canonicalUrl, gated: !canAccess,
|
|
69
|
+
authorNode: item.authorNode, requestOrigin,
|
|
70
|
+
}))}
|
|
71
|
+
</script>
|
|
72
|
+
|
|
73
|
+
<marko-web-digital-edition-article
|
|
74
|
+
manifest=manifest
|
|
75
|
+
item=item
|
|
76
|
+
can-access=canAccess
|
|
77
|
+
heading-level=1
|
|
78
|
+
/>
|
|
79
|
+
|
|
80
|
+
<!-- Inline sign-in form after the teaser: same flow as a hard-gated article, source digitalEdition. -->
|
|
81
|
+
<marko-web-digital-edition-gate manifest=manifest item=item context=context variant="inline" />
|
|
82
|
+
</marko-web-identity-x-access>
|
|
83
|
+
|
|
84
|
+
<nav class="edition-pager" aria-label="More from this issue">
|
|
85
|
+
<if(prev)>
|
|
86
|
+
<a class="edition-pager__link edition-pager__link--prev" href=editionPath(manifest.issueId, { slug: prev.slug })>
|
|
87
|
+
<span class="edition-pager__dir">← Previous</span>
|
|
88
|
+
<span class="edition-pager__title">${prev.headline || "Untitled"}</span>
|
|
89
|
+
</a>
|
|
90
|
+
</if>
|
|
91
|
+
<if(next)>
|
|
92
|
+
<a class="edition-pager__link edition-pager__link--next" href=editionPath(manifest.issueId, { slug: next.slug })>
|
|
93
|
+
<span class="edition-pager__dir">Next →</span>
|
|
94
|
+
<span class="edition-pager__title">${next.headline || "Untitled"}</span>
|
|
95
|
+
</a>
|
|
96
|
+
</if>
|
|
97
|
+
</nav>
|
|
98
|
+
|
|
99
|
+
<marko-web-digital-edition-toc manifest=manifest items=toc current-slug=item.slug />
|
|
100
|
+
</div>
|
|
101
|
+
|
|
102
|
+
<marko-web-digital-edition-tracking manifest=manifest view="read" item=item />
|
|
103
|
+
</div>
|
|
104
|
+
</@section>
|
|
105
|
+
</marko-web-page-wrapper>
|
|
106
|
+
</@page>
|
|
107
|
+
</@container>
|
|
108
|
+
</>
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
// Compiled using marko@4.20.2 - DO NOT EDIT
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var marko_template = module.exports = require("marko/dist/html").t(__filename),
|
|
5
|
+
marko_componentType = "/@mindful-web/marko-web-digital-edition$1.95.0/templates/article.marko",
|
|
6
|
+
marko_component = require("./article.marko"),
|
|
7
|
+
marko_renderer = require("marko/dist/runtime/components/renderer"),
|
|
8
|
+
module_lib_module = require("../lib"),
|
|
9
|
+
lib_module = module_lib_module.default || module_lib_module,
|
|
10
|
+
editionPath = module_lib_module.editionPath,
|
|
11
|
+
buildArticleLdJson = module_lib_module.buildArticleLdJson,
|
|
12
|
+
isIndexable = module_lib_module.isIndexable,
|
|
13
|
+
marko_web_default_page_metadata_template = require("@mindful-web/marko-web/components/page/metadata/default.marko"),
|
|
14
|
+
marko_loadTag = require("marko/dist/runtime/helpers/load-tag"),
|
|
15
|
+
marko_web_default_page_metadata_tag = marko_loadTag(marko_web_default_page_metadata_template),
|
|
16
|
+
marko_web_digital_edition_theme_template = require("../components/theme.marko"),
|
|
17
|
+
marko_web_digital_edition_theme_tag = marko_loadTag(marko_web_digital_edition_theme_template),
|
|
18
|
+
marko_web_gtm_push_template = require("@mindful-web/marko-web-gtm/components/push.marko"),
|
|
19
|
+
marko_web_gtm_push_tag = marko_loadTag(marko_web_gtm_push_template),
|
|
20
|
+
marko_web_gtm_default_context_template = require("@mindful-web/marko-web-gtm/components/context/default.marko"),
|
|
21
|
+
marko_web_gtm_default_context_tag = marko_loadTag(marko_web_gtm_default_context_template),
|
|
22
|
+
marko_web_digital_edition_toolbar_template = require("../components/toolbar.marko"),
|
|
23
|
+
marko_web_digital_edition_toolbar_tag = marko_loadTag(marko_web_digital_edition_toolbar_template),
|
|
24
|
+
helpers_escape_xml = require("marko/dist/runtime/html/helpers/escape-xml"),
|
|
25
|
+
marko_escapeXml = helpers_escape_xml.x,
|
|
26
|
+
marko_attr = require("marko/dist/runtime/html/helpers/attr"),
|
|
27
|
+
marko_escapeScript = require("marko/dist/runtime/html/helpers/escape-script-placeholder"),
|
|
28
|
+
marko_web_digital_edition_article_template = require("../components/article-body.marko"),
|
|
29
|
+
marko_web_digital_edition_article_tag = marko_loadTag(marko_web_digital_edition_article_template),
|
|
30
|
+
marko_web_digital_edition_gate_template = require("../components/gate.marko"),
|
|
31
|
+
marko_web_digital_edition_gate_tag = marko_loadTag(marko_web_digital_edition_gate_template),
|
|
32
|
+
marko_web_identity_x_access_template = require("@mindful-web/marko-web-identity-x/components/access.marko"),
|
|
33
|
+
marko_web_identity_x_access_tag = marko_loadTag(marko_web_identity_x_access_template),
|
|
34
|
+
marko_web_digital_edition_toc_template = require("../components/toc.marko"),
|
|
35
|
+
marko_web_digital_edition_toc_tag = marko_loadTag(marko_web_digital_edition_toc_template),
|
|
36
|
+
marko_web_digital_edition_tracking_template = require("../components/tracking.marko"),
|
|
37
|
+
marko_web_digital_edition_tracking_tag = marko_loadTag(marko_web_digital_edition_tracking_template),
|
|
38
|
+
marko_web_page_wrapper_template = require("@mindful-web/marko-web/components/page/wrapper.marko"),
|
|
39
|
+
marko_web_page_wrapper_tag = marko_loadTag(marko_web_page_wrapper_template),
|
|
40
|
+
marko_dynamicTag = require("marko/dist/runtime/helpers/dynamic-tag");
|
|
41
|
+
|
|
42
|
+
function render(input, out, __component, component, state) {
|
|
43
|
+
var data = input;
|
|
44
|
+
|
|
45
|
+
const { requestOrigin, document, site } = out.global;
|
|
46
|
+
|
|
47
|
+
const {
|
|
48
|
+
manifest, item, canonicalUrl, prev, next, position, total, toc,
|
|
49
|
+
} = data;
|
|
50
|
+
|
|
51
|
+
const type = "digital-edition-article";
|
|
52
|
+
|
|
53
|
+
// The page title component appends the site name itself; adding the publication
|
|
54
|
+
|
|
55
|
+
// here doubled it ("… | Athletic Business | Athletic Business").
|
|
56
|
+
|
|
57
|
+
const title = item.headline || manifest.name;
|
|
58
|
+
|
|
59
|
+
const description = item.deck || `From the ${manifest.name} issue of ${manifest.publication}.`;
|
|
60
|
+
|
|
61
|
+
const hubPath = editionPath(manifest.issueId);
|
|
62
|
+
|
|
63
|
+
// Site-wide review hold (the site-config key named by the routes factory's
|
|
64
|
+
|
|
65
|
+
// `noIndexKey`) or a per-article hold from the ingest — either keeps the page out
|
|
66
|
+
|
|
67
|
+
// of search.
|
|
68
|
+
|
|
69
|
+
const { noIndexKey } = (out.global.digitalEdition || {});
|
|
70
|
+
|
|
71
|
+
const noIndex = Boolean(noIndexKey && site.get(noIndexKey)) || !isIndexable(item);
|
|
72
|
+
|
|
73
|
+
marko_dynamicTag(out, document, function() {
|
|
74
|
+
return {
|
|
75
|
+
image: manifest.coverImage,
|
|
76
|
+
head: {
|
|
77
|
+
renderBody: function(out) {
|
|
78
|
+
marko_web_default_page_metadata_tag({
|
|
79
|
+
title: title,
|
|
80
|
+
description: description,
|
|
81
|
+
canonicalUrl: canonicalUrl,
|
|
82
|
+
noIndex: noIndex
|
|
83
|
+
}, out, __component, "2");
|
|
84
|
+
|
|
85
|
+
marko_web_digital_edition_theme_tag({
|
|
86
|
+
view: "read"
|
|
87
|
+
}, out, __component, "3");
|
|
88
|
+
|
|
89
|
+
marko_web_gtm_default_context_tag({
|
|
90
|
+
type: type,
|
|
91
|
+
renderBody: function(out, { context }) {
|
|
92
|
+
marko_web_gtm_push_tag({
|
|
93
|
+
name: "dataLayer",
|
|
94
|
+
data: context
|
|
95
|
+
}, out, __component, "5");
|
|
96
|
+
}
|
|
97
|
+
}, out, __component, "4");
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
container: {
|
|
101
|
+
page: {
|
|
102
|
+
for: type,
|
|
103
|
+
renderBody: function(out) {
|
|
104
|
+
marko_web_page_wrapper_tag({
|
|
105
|
+
blockName: "page-wrapper",
|
|
106
|
+
tag: "div",
|
|
107
|
+
sections: [
|
|
108
|
+
{
|
|
109
|
+
tag: "div",
|
|
110
|
+
renderBody: function(out) {
|
|
111
|
+
out.w("<div class=\"edition edition--article\">");
|
|
112
|
+
|
|
113
|
+
marko_web_digital_edition_toolbar_tag({
|
|
114
|
+
manifest: manifest,
|
|
115
|
+
view: "read"
|
|
116
|
+
}, out, __component, "11");
|
|
117
|
+
|
|
118
|
+
out.w("<div class=\"edition-article-page\"><nav class=\"edition-article-page__breadcrumb\"><a" +
|
|
119
|
+
marko_attr("href", hubPath) +
|
|
120
|
+
">" +
|
|
121
|
+
marko_escapeXml(manifest.publication) +
|
|
122
|
+
" · " +
|
|
123
|
+
marko_escapeXml(manifest.name) +
|
|
124
|
+
"</a>");
|
|
125
|
+
|
|
126
|
+
if (position) {
|
|
127
|
+
out.w("<span class=\"edition-article-page__position\">" +
|
|
128
|
+
marko_escapeXml(position) +
|
|
129
|
+
" of " +
|
|
130
|
+
marko_escapeXml(total) +
|
|
131
|
+
"</span>");
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
out.w("</nav>");
|
|
135
|
+
|
|
136
|
+
marko_web_identity_x_access_tag({
|
|
137
|
+
enabled: true,
|
|
138
|
+
renderBody: function(out, context) {
|
|
139
|
+
const canAccess = Boolean(context && context.canAccess);
|
|
140
|
+
|
|
141
|
+
out.w("<script type=\"application/ld+json\">" +
|
|
142
|
+
marko_escapeScript(("\n " + JSON.stringify(buildArticleLdJson({
|
|
143
|
+
manifest: manifest,
|
|
144
|
+
item: item,
|
|
145
|
+
canonicalUrl: canonicalUrl,
|
|
146
|
+
gated: !canAccess,
|
|
147
|
+
authorNode: item.authorNode,
|
|
148
|
+
requestOrigin: requestOrigin
|
|
149
|
+
}))) + "\n ") +
|
|
150
|
+
"</script>");
|
|
151
|
+
|
|
152
|
+
marko_web_digital_edition_article_tag({
|
|
153
|
+
manifest: manifest,
|
|
154
|
+
item: item,
|
|
155
|
+
canAccess: canAccess,
|
|
156
|
+
headingLevel: 1
|
|
157
|
+
}, out, __component, "17");
|
|
158
|
+
|
|
159
|
+
marko_web_digital_edition_gate_tag({
|
|
160
|
+
manifest: manifest,
|
|
161
|
+
item: item,
|
|
162
|
+
context: context,
|
|
163
|
+
variant: "inline"
|
|
164
|
+
}, out, __component, "18");
|
|
165
|
+
}
|
|
166
|
+
}, out, __component, "16");
|
|
167
|
+
|
|
168
|
+
out.w("<nav class=\"edition-pager\" aria-label=\"More from this issue\">");
|
|
169
|
+
|
|
170
|
+
if (prev) {
|
|
171
|
+
out.w("<a class=\"edition-pager__link edition-pager__link--prev\"" +
|
|
172
|
+
marko_attr("href", editionPath(manifest.issueId, {
|
|
173
|
+
slug: prev.slug
|
|
174
|
+
})) +
|
|
175
|
+
"><span class=\"edition-pager__dir\">← Previous</span><span class=\"edition-pager__title\">" +
|
|
176
|
+
marko_escapeXml(prev.headline || "Untitled") +
|
|
177
|
+
"</span></a>");
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
if (next) {
|
|
181
|
+
out.w("<a class=\"edition-pager__link edition-pager__link--next\"" +
|
|
182
|
+
marko_attr("href", editionPath(manifest.issueId, {
|
|
183
|
+
slug: next.slug
|
|
184
|
+
})) +
|
|
185
|
+
"><span class=\"edition-pager__dir\">Next →</span><span class=\"edition-pager__title\">" +
|
|
186
|
+
marko_escapeXml(next.headline || "Untitled") +
|
|
187
|
+
"</span></a>");
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
out.w("</nav>");
|
|
191
|
+
|
|
192
|
+
marko_web_digital_edition_toc_tag({
|
|
193
|
+
manifest: manifest,
|
|
194
|
+
items: toc,
|
|
195
|
+
currentSlug: item.slug
|
|
196
|
+
}, out, __component, "26");
|
|
197
|
+
|
|
198
|
+
out.w("</div>");
|
|
199
|
+
|
|
200
|
+
marko_web_digital_edition_tracking_tag({
|
|
201
|
+
manifest: manifest,
|
|
202
|
+
view: "read",
|
|
203
|
+
item: item
|
|
204
|
+
}, out, __component, "27");
|
|
205
|
+
|
|
206
|
+
out.w("</div>");
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
]
|
|
210
|
+
}, out, __component, "8");
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
}, null, null, null, __component, "0");
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
marko_template._ = marko_renderer(render, {
|
|
219
|
+
e_: marko_componentType
|
|
220
|
+
}, marko_component);
|
|
221
|
+
|
|
222
|
+
marko_template.meta = {
|
|
223
|
+
id: "/@mindful-web/marko-web-digital-edition$1.95.0/templates/article.marko",
|
|
224
|
+
component: "./article.marko",
|
|
225
|
+
tags: [
|
|
226
|
+
"@mindful-web/marko-web/components/page/metadata/default.marko",
|
|
227
|
+
"../components/theme.marko",
|
|
228
|
+
"@mindful-web/marko-web-gtm/components/push.marko",
|
|
229
|
+
"@mindful-web/marko-web-gtm/components/context/default.marko",
|
|
230
|
+
"../components/toolbar.marko",
|
|
231
|
+
"../components/article-body.marko",
|
|
232
|
+
"../components/gate.marko",
|
|
233
|
+
"@mindful-web/marko-web-identity-x/components/access.marko",
|
|
234
|
+
"../components/toc.marko",
|
|
235
|
+
"../components/tracking.marko",
|
|
236
|
+
"@mindful-web/marko-web/components/page/wrapper.marko"
|
|
237
|
+
]
|
|
238
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { pageImageUrl, editionPath } from "../lib";
|
|
2
|
+
|
|
3
|
+
$ const { requestOrigin, document, site } = out.global;
|
|
4
|
+
$ const { manifest, view, page } = data;
|
|
5
|
+
$ // Review hold: the site-config key named by the routes factory (`noIndexKey`,
|
|
6
|
+
$ // default `digitalEdition.native.noIndex`) emits a robots noindex on the hub.
|
|
7
|
+
$ const { noIndexKey } = (out.global.digitalEdition || {});
|
|
8
|
+
$ const noIndex = Boolean(noIndexKey && site.get(noIndexKey));
|
|
9
|
+
|
|
10
|
+
$ const type = "digital-edition";
|
|
11
|
+
$ // The page title component appends the site name itself, so the publication is
|
|
12
|
+
$ // not repeated here (it produced "… | Athletic Business | Athletic Business").
|
|
13
|
+
$ const title = `${manifest.name} Digital Edition`;
|
|
14
|
+
$ const description = `Read the ${manifest.name} issue of ${manifest.publication}.`;
|
|
15
|
+
$ // Absolute, for the structured data only. theme-default-page already emits the
|
|
16
|
+
$ // <link rel="canonical"> itself from requestOrigin + req.path, so this template
|
|
17
|
+
$ // must NOT emit a second one — two canonical tags are conflicting signals.
|
|
18
|
+
$ const canonicalUrl = `${requestOrigin || ""}${editionPath(manifest.issueId)}`;
|
|
19
|
+
$ const image = manifest.coverImage || pageImageUrl(manifest, 1, { w: 1200 });
|
|
20
|
+
|
|
21
|
+
<!--
|
|
22
|
+
Digital edition page.
|
|
23
|
+
|
|
24
|
+
Gating: the whole edition sits behind <marko-web-identity-x-access>, which resolves
|
|
25
|
+
access server-side and honours both an authenticated IdentityX session and an
|
|
26
|
+
identified visitor. The structured data still advertises the issue and its contents
|
|
27
|
+
to search, so the page is gated AND indexable (unless the config review hold is on).
|
|
28
|
+
|
|
29
|
+
Renders the site document directly rather than through <theme-default-page>, which
|
|
30
|
+
does not forward `no-index` to the metadata component. The metadata component owns
|
|
31
|
+
the single canonical and robots tags — never hand-roll either here.
|
|
32
|
+
-->
|
|
33
|
+
<${document} image=image>
|
|
34
|
+
<@head>
|
|
35
|
+
<marko-web-default-page-metadata title=title description=description no-index=noIndex />
|
|
36
|
+
<!-- Must be in <head>: sets the theme attribute before first paint. -->
|
|
37
|
+
<marko-web-digital-edition-theme view=view />
|
|
38
|
+
<marko-web-gtm-default-context|{ context }| type=type>
|
|
39
|
+
<marko-web-gtm-push data=context />
|
|
40
|
+
</marko-web-gtm-default-context>
|
|
41
|
+
</@head>
|
|
42
|
+
<@container>
|
|
43
|
+
<@page for=type>
|
|
44
|
+
<marko-web-page-wrapper>
|
|
45
|
+
<@section>
|
|
46
|
+
<div class=`edition edition--${view}`>
|
|
47
|
+
<marko-web-digital-edition-toolbar manifest=manifest view=view />
|
|
48
|
+
|
|
49
|
+
<marko-web-identity-x-access|context| enabled=true>
|
|
50
|
+
$ const canAccess = Boolean(context && context.canAccess);
|
|
51
|
+
|
|
52
|
+
<marko-web-digital-edition-ld-json manifest=manifest gated=!canAccess canonical-url=canonicalUrl />
|
|
53
|
+
|
|
54
|
+
<!--
|
|
55
|
+
`view` is honoured in BOTH access states. An unentitled visitor still
|
|
56
|
+
gets the view they asked for, just truncated — articles cut to their
|
|
57
|
+
opening paragraph, the replica cut to a few pages — so the toolbar
|
|
58
|
+
toggle never silently does nothing. The truncated body carries the
|
|
59
|
+
class named by the JSON-LD cssSelector.
|
|
60
|
+
-->
|
|
61
|
+
<if(canAccess)>
|
|
62
|
+
<if(view === "print")>
|
|
63
|
+
<marko-web-digital-edition-replica manifest=manifest page=page can-access=true />
|
|
64
|
+
</if>
|
|
65
|
+
<else>
|
|
66
|
+
<marko-web-digital-edition-reflow manifest=manifest can-access=true />
|
|
67
|
+
</else>
|
|
68
|
+
</if>
|
|
69
|
+
<else>
|
|
70
|
+
<div class="edition-gated">
|
|
71
|
+
<if(view === "print")>
|
|
72
|
+
<marko-web-digital-edition-replica manifest=manifest page=page can-access=false />
|
|
73
|
+
</if>
|
|
74
|
+
<else>
|
|
75
|
+
<marko-web-digital-edition-reflow manifest=manifest can-access=false />
|
|
76
|
+
</else>
|
|
77
|
+
<!-- Fixed bottom sign-in bar: same flow as the content meter, source digitalEdition. -->
|
|
78
|
+
<marko-web-digital-edition-gate manifest=manifest context=context variant="bar" />
|
|
79
|
+
</div>
|
|
80
|
+
</else>
|
|
81
|
+
</marko-web-identity-x-access>
|
|
82
|
+
|
|
83
|
+
<!-- Progressive enhancement: appends the remaining articles as you scroll. -->
|
|
84
|
+
<if(view === "read")>
|
|
85
|
+
<marko-web-digital-edition-scroll manifest=manifest />
|
|
86
|
+
</if>
|
|
87
|
+
|
|
88
|
+
<marko-web-digital-edition-tracking manifest=manifest view=view />
|
|
89
|
+
</div>
|
|
90
|
+
</@section>
|
|
91
|
+
</marko-web-page-wrapper>
|
|
92
|
+
</@page>
|
|
93
|
+
</@container>
|
|
94
|
+
</>
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
// Compiled using marko@4.20.2 - DO NOT EDIT
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var marko_template = module.exports = require("marko/dist/html").t(__filename),
|
|
5
|
+
marko_componentType = "/@mindful-web/marko-web-digital-edition$1.95.0/templates/hub.marko",
|
|
6
|
+
marko_component = require("./hub.marko"),
|
|
7
|
+
marko_renderer = require("marko/dist/runtime/components/renderer"),
|
|
8
|
+
module_lib_module = require("../lib"),
|
|
9
|
+
lib_module = module_lib_module.default || module_lib_module,
|
|
10
|
+
pageImageUrl = module_lib_module.pageImageUrl,
|
|
11
|
+
editionPath = module_lib_module.editionPath,
|
|
12
|
+
marko_web_default_page_metadata_template = require("@mindful-web/marko-web/components/page/metadata/default.marko"),
|
|
13
|
+
marko_loadTag = require("marko/dist/runtime/helpers/load-tag"),
|
|
14
|
+
marko_web_default_page_metadata_tag = marko_loadTag(marko_web_default_page_metadata_template),
|
|
15
|
+
marko_web_digital_edition_theme_template = require("../components/theme.marko"),
|
|
16
|
+
marko_web_digital_edition_theme_tag = marko_loadTag(marko_web_digital_edition_theme_template),
|
|
17
|
+
marko_web_gtm_push_template = require("@mindful-web/marko-web-gtm/components/push.marko"),
|
|
18
|
+
marko_web_gtm_push_tag = marko_loadTag(marko_web_gtm_push_template),
|
|
19
|
+
marko_web_gtm_default_context_template = require("@mindful-web/marko-web-gtm/components/context/default.marko"),
|
|
20
|
+
marko_web_gtm_default_context_tag = marko_loadTag(marko_web_gtm_default_context_template),
|
|
21
|
+
marko_web_digital_edition_toolbar_template = require("../components/toolbar.marko"),
|
|
22
|
+
marko_web_digital_edition_toolbar_tag = marko_loadTag(marko_web_digital_edition_toolbar_template),
|
|
23
|
+
marko_web_digital_edition_ld_json_template = require("../components/ld-json.marko"),
|
|
24
|
+
marko_web_digital_edition_ld_json_tag = marko_loadTag(marko_web_digital_edition_ld_json_template),
|
|
25
|
+
marko_web_digital_edition_replica_template = require("../components/replica.marko"),
|
|
26
|
+
marko_web_digital_edition_replica_tag = marko_loadTag(marko_web_digital_edition_replica_template),
|
|
27
|
+
marko_web_digital_edition_reflow_template = require("../components/reflow.marko"),
|
|
28
|
+
marko_web_digital_edition_reflow_tag = marko_loadTag(marko_web_digital_edition_reflow_template),
|
|
29
|
+
marko_web_digital_edition_gate_template = require("../components/gate.marko"),
|
|
30
|
+
marko_web_digital_edition_gate_tag = marko_loadTag(marko_web_digital_edition_gate_template),
|
|
31
|
+
marko_web_identity_x_access_template = require("@mindful-web/marko-web-identity-x/components/access.marko"),
|
|
32
|
+
marko_web_identity_x_access_tag = marko_loadTag(marko_web_identity_x_access_template),
|
|
33
|
+
marko_web_digital_edition_scroll_template = require("../components/scroll.marko"),
|
|
34
|
+
marko_web_digital_edition_scroll_tag = marko_loadTag(marko_web_digital_edition_scroll_template),
|
|
35
|
+
marko_web_digital_edition_tracking_template = require("../components/tracking.marko"),
|
|
36
|
+
marko_web_digital_edition_tracking_tag = marko_loadTag(marko_web_digital_edition_tracking_template),
|
|
37
|
+
marko_classAttr = require("marko/dist/runtime/html/helpers/class-attr"),
|
|
38
|
+
marko_web_page_wrapper_template = require("@mindful-web/marko-web/components/page/wrapper.marko"),
|
|
39
|
+
marko_web_page_wrapper_tag = marko_loadTag(marko_web_page_wrapper_template),
|
|
40
|
+
marko_dynamicTag = require("marko/dist/runtime/helpers/dynamic-tag");
|
|
41
|
+
|
|
42
|
+
function render(input, out, __component, component, state) {
|
|
43
|
+
var data = input;
|
|
44
|
+
|
|
45
|
+
const { requestOrigin, document, site } = out.global;
|
|
46
|
+
|
|
47
|
+
const { manifest, view, page } = data;
|
|
48
|
+
|
|
49
|
+
// Review hold: the site-config key named by the routes factory (`noIndexKey`,
|
|
50
|
+
|
|
51
|
+
// default `digitalEdition.native.noIndex`) emits a robots noindex on the hub.
|
|
52
|
+
|
|
53
|
+
const { noIndexKey } = (out.global.digitalEdition || {});
|
|
54
|
+
|
|
55
|
+
const noIndex = Boolean(noIndexKey && site.get(noIndexKey));
|
|
56
|
+
|
|
57
|
+
const type = "digital-edition";
|
|
58
|
+
|
|
59
|
+
// The page title component appends the site name itself, so the publication is
|
|
60
|
+
|
|
61
|
+
// not repeated here (it produced "… | Athletic Business | Athletic Business").
|
|
62
|
+
|
|
63
|
+
const title = `${manifest.name} Digital Edition`;
|
|
64
|
+
|
|
65
|
+
const description = `Read the ${manifest.name} issue of ${manifest.publication}.`;
|
|
66
|
+
|
|
67
|
+
// Absolute, for the structured data only. theme-default-page already emits the
|
|
68
|
+
|
|
69
|
+
// <link rel="canonical"> itself from requestOrigin + req.path, so this template
|
|
70
|
+
|
|
71
|
+
// must NOT emit a second one — two canonical tags are conflicting signals.
|
|
72
|
+
|
|
73
|
+
const canonicalUrl = `${requestOrigin || ""}${editionPath(manifest.issueId)}`;
|
|
74
|
+
|
|
75
|
+
const image = manifest.coverImage || pageImageUrl(manifest, 1, { w: 1200 });
|
|
76
|
+
|
|
77
|
+
marko_dynamicTag(out, document, function() {
|
|
78
|
+
return {
|
|
79
|
+
image: image,
|
|
80
|
+
head: {
|
|
81
|
+
renderBody: function(out) {
|
|
82
|
+
marko_web_default_page_metadata_tag({
|
|
83
|
+
title: title,
|
|
84
|
+
description: description,
|
|
85
|
+
noIndex: noIndex
|
|
86
|
+
}, out, __component, "2");
|
|
87
|
+
|
|
88
|
+
marko_web_digital_edition_theme_tag({
|
|
89
|
+
view: view
|
|
90
|
+
}, out, __component, "3");
|
|
91
|
+
|
|
92
|
+
marko_web_gtm_default_context_tag({
|
|
93
|
+
type: type,
|
|
94
|
+
renderBody: function(out, { context }) {
|
|
95
|
+
marko_web_gtm_push_tag({
|
|
96
|
+
name: "dataLayer",
|
|
97
|
+
data: context
|
|
98
|
+
}, out, __component, "5");
|
|
99
|
+
}
|
|
100
|
+
}, out, __component, "4");
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
container: {
|
|
104
|
+
page: {
|
|
105
|
+
for: type,
|
|
106
|
+
renderBody: function(out) {
|
|
107
|
+
marko_web_page_wrapper_tag({
|
|
108
|
+
blockName: "page-wrapper",
|
|
109
|
+
tag: "div",
|
|
110
|
+
sections: [
|
|
111
|
+
{
|
|
112
|
+
tag: "div",
|
|
113
|
+
renderBody: function(out) {
|
|
114
|
+
out.w("<div" +
|
|
115
|
+
marko_classAttr("edition edition--" + view) +
|
|
116
|
+
">");
|
|
117
|
+
|
|
118
|
+
marko_web_digital_edition_toolbar_tag({
|
|
119
|
+
manifest: manifest,
|
|
120
|
+
view: view
|
|
121
|
+
}, out, __component, "11");
|
|
122
|
+
|
|
123
|
+
marko_web_identity_x_access_tag({
|
|
124
|
+
enabled: true,
|
|
125
|
+
renderBody: function(out, context) {
|
|
126
|
+
const canAccess = Boolean(context && context.canAccess);
|
|
127
|
+
|
|
128
|
+
marko_web_digital_edition_ld_json_tag({
|
|
129
|
+
manifest: manifest,
|
|
130
|
+
gated: !canAccess,
|
|
131
|
+
canonicalUrl: canonicalUrl
|
|
132
|
+
}, out, __component, "13");
|
|
133
|
+
|
|
134
|
+
if (canAccess) {
|
|
135
|
+
if (view === "print") {
|
|
136
|
+
marko_web_digital_edition_replica_tag({
|
|
137
|
+
manifest: manifest,
|
|
138
|
+
page: page,
|
|
139
|
+
canAccess: true
|
|
140
|
+
}, out, __component, "14");
|
|
141
|
+
} else {
|
|
142
|
+
marko_web_digital_edition_reflow_tag({
|
|
143
|
+
manifest: manifest,
|
|
144
|
+
canAccess: true
|
|
145
|
+
}, out, __component, "15");
|
|
146
|
+
}
|
|
147
|
+
} else {
|
|
148
|
+
out.w("<div class=\"edition-gated\">");
|
|
149
|
+
|
|
150
|
+
if (view === "print") {
|
|
151
|
+
marko_web_digital_edition_replica_tag({
|
|
152
|
+
manifest: manifest,
|
|
153
|
+
page: page,
|
|
154
|
+
canAccess: false
|
|
155
|
+
}, out, __component, "17");
|
|
156
|
+
} else {
|
|
157
|
+
marko_web_digital_edition_reflow_tag({
|
|
158
|
+
manifest: manifest,
|
|
159
|
+
canAccess: false
|
|
160
|
+
}, out, __component, "18");
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
marko_web_digital_edition_gate_tag({
|
|
164
|
+
manifest: manifest,
|
|
165
|
+
context: context,
|
|
166
|
+
variant: "bar"
|
|
167
|
+
}, out, __component, "19");
|
|
168
|
+
|
|
169
|
+
out.w("</div>");
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}, out, __component, "12");
|
|
173
|
+
|
|
174
|
+
if (view === "read") {
|
|
175
|
+
marko_web_digital_edition_scroll_tag({
|
|
176
|
+
manifest: manifest
|
|
177
|
+
}, out, __component, "20");
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
marko_web_digital_edition_tracking_tag({
|
|
181
|
+
manifest: manifest,
|
|
182
|
+
view: view
|
|
183
|
+
}, out, __component, "21");
|
|
184
|
+
|
|
185
|
+
out.w("</div>");
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
]
|
|
189
|
+
}, out, __component, "8");
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
}, null, null, null, __component, "0");
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
marko_template._ = marko_renderer(render, {
|
|
198
|
+
e_: marko_componentType
|
|
199
|
+
}, marko_component);
|
|
200
|
+
|
|
201
|
+
marko_template.meta = {
|
|
202
|
+
id: "/@mindful-web/marko-web-digital-edition$1.95.0/templates/hub.marko",
|
|
203
|
+
component: "./hub.marko",
|
|
204
|
+
tags: [
|
|
205
|
+
"@mindful-web/marko-web/components/page/metadata/default.marko",
|
|
206
|
+
"../components/theme.marko",
|
|
207
|
+
"@mindful-web/marko-web-gtm/components/push.marko",
|
|
208
|
+
"@mindful-web/marko-web-gtm/components/context/default.marko",
|
|
209
|
+
"../components/toolbar.marko",
|
|
210
|
+
"../components/ld-json.marko",
|
|
211
|
+
"../components/replica.marko",
|
|
212
|
+
"../components/reflow.marko",
|
|
213
|
+
"../components/gate.marko",
|
|
214
|
+
"@mindful-web/marko-web-identity-x/components/access.marko",
|
|
215
|
+
"../components/scroll.marko",
|
|
216
|
+
"../components/tracking.marko",
|
|
217
|
+
"@mindful-web/marko-web/components/page/wrapper.marko"
|
|
218
|
+
]
|
|
219
|
+
};
|