sfc-utils 1.4.26 → 1.4.28
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.
|
@@ -3,7 +3,7 @@ import React from 'react'
|
|
|
3
3
|
import { Helmet } from 'react-helmet'
|
|
4
4
|
import { appCheck, getBrands2 } from "../../index"
|
|
5
5
|
|
|
6
|
-
const LayoutHelmet = ({ meta, url_add, noindex
|
|
6
|
+
const LayoutHelmet = ({ meta, url_add, noindex=false, schemaOverride={} }) => {
|
|
7
7
|
let {
|
|
8
8
|
EMBEDDED,
|
|
9
9
|
MAIN_DOMAIN,
|
|
@@ -62,6 +62,35 @@ const LayoutHelmet = ({ meta, url_add, noindex = false }) => {
|
|
|
62
62
|
favHref = "https://files.sfchronicle.com/devhub-logos/DHlogos-sm.png"
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
+
// Set the default schema that will be used as a fallback
|
|
66
|
+
let schemaContent = `{
|
|
67
|
+
"@context": "http://schema.org",
|
|
68
|
+
"@type": "${schemaOverride.type || "NewsArticle"}",
|
|
69
|
+
"mainEntityOfPage": {
|
|
70
|
+
"@type": "WebPage",
|
|
71
|
+
"@id": "${MAIN_DOMAIN}/${SUBFOLDER}${OPT_SLASH}${SLUG}/${url_add}"
|
|
72
|
+
},
|
|
73
|
+
"headline": "${TITLE}",
|
|
74
|
+
"image": {
|
|
75
|
+
"@type": "ImageObject",
|
|
76
|
+
"url": "${IMAGE}"
|
|
77
|
+
},
|
|
78
|
+
"datePublished": "${ISO_PUBDATE}",
|
|
79
|
+
"dateModified": "${ISO_MODDATE}",
|
|
80
|
+
"author": ${JSON.stringify(authorObj)},
|
|
81
|
+
"publisher": {
|
|
82
|
+
"@type": "Organization",
|
|
83
|
+
"name": "${thisBrand.attributes.siteName}",
|
|
84
|
+
"logo": {
|
|
85
|
+
"@type": "ImageObject",
|
|
86
|
+
"url": "/apple-touch-icon.png",
|
|
87
|
+
"width": "180",
|
|
88
|
+
"height": "180"
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"description": "${DESCRIPTION}"
|
|
92
|
+
}`
|
|
93
|
+
|
|
65
94
|
return (
|
|
66
95
|
<Helmet>
|
|
67
96
|
<title>{TITLE}</title>
|
|
@@ -97,33 +126,8 @@ const LayoutHelmet = ({ meta, url_add, noindex = false }) => {
|
|
|
97
126
|
<meta property="og:image" content={IMAGE} />
|
|
98
127
|
<meta property="og:description" content={DESCRIPTION} />
|
|
99
128
|
|
|
100
|
-
<script data-schema="NewsArticle" type="application/ld+json">{
|
|
101
|
-
|
|
102
|
-
"@type": "NewsArticle",
|
|
103
|
-
"mainEntityOfPage": {
|
|
104
|
-
"@type": "WebPage",
|
|
105
|
-
"@id": "${MAIN_DOMAIN}/${SUBFOLDER}${OPT_SLASH}${SLUG}/${url_add}"
|
|
106
|
-
},
|
|
107
|
-
"headline": "${TITLE}",
|
|
108
|
-
"image": {
|
|
109
|
-
"@type": "ImageObject",
|
|
110
|
-
"url": "${IMAGE}"
|
|
111
|
-
},
|
|
112
|
-
"datePublished": "${ISO_PUBDATE}",
|
|
113
|
-
"dateModified": "${ISO_MODDATE}",
|
|
114
|
-
"author": ${JSON.stringify(authorObj)},
|
|
115
|
-
"publisher": {
|
|
116
|
-
"@type": "Organization",
|
|
117
|
-
"name": "${thisBrand.attributes.siteName}",
|
|
118
|
-
"logo": {
|
|
119
|
-
"@type": "ImageObject",
|
|
120
|
-
"url": "/apple-touch-icon.png",
|
|
121
|
-
"width": "180",
|
|
122
|
-
"height": "180"
|
|
123
|
-
}
|
|
124
|
-
},
|
|
125
|
-
"description": "${DESCRIPTION}"
|
|
126
|
-
}`}</script>
|
|
129
|
+
<script data-schema={schemaOverride.type || "NewsArticle"} type="application/ld+json">{schemaOverride.content || schemaContent}</script>
|
|
130
|
+
|
|
127
131
|
</Helmet>
|
|
128
132
|
)
|
|
129
133
|
}
|
package/package.json
CHANGED
|
@@ -83,8 +83,6 @@ h1 {
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
// TO DO: Add support for side-by-side visuals
|
|
87
|
-
|
|
88
86
|
.inline-figure.wide, .inline-figure.full, .inline-figure.large {
|
|
89
87
|
&.graphic-wrapper {
|
|
90
88
|
@media @max-desktop {
|
|
@@ -99,6 +97,97 @@ h1 {
|
|
|
99
97
|
}
|
|
100
98
|
}
|
|
101
99
|
|
|
100
|
+
//side-by-side photos
|
|
101
|
+
.side-by-side-wrapper {
|
|
102
|
+
@media (max-width: 1200px) {
|
|
103
|
+
padding-left: @s16;
|
|
104
|
+
padding-right: @s16;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.side-by-side {
|
|
109
|
+
max-width: 592px;
|
|
110
|
+
width: 100%;
|
|
111
|
+
display: inline-block;
|
|
112
|
+
vertical-align: top;
|
|
113
|
+
@media (max-width: 1200px){
|
|
114
|
+
width: calc(50% - 4px);
|
|
115
|
+
// max-width: 640px;
|
|
116
|
+
}
|
|
117
|
+
@media @tablet {
|
|
118
|
+
width: 100%;
|
|
119
|
+
max-width: 640px;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
.side-by-side-left {
|
|
123
|
+
margin-right: @s4;
|
|
124
|
+
@media @tablet {
|
|
125
|
+
margin-bottom: @s8;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
.side-by-side-right {
|
|
129
|
+
margin-left: @s4;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.side-by-side-left, .side-by-side-right{
|
|
133
|
+
@media @tablet {
|
|
134
|
+
margin-right: auto;
|
|
135
|
+
margin-left: auto;
|
|
136
|
+
display: block;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
.side-by-side-caption-wrapper {
|
|
140
|
+
margin-bottom: @s24;
|
|
141
|
+
margin-top: @s4;
|
|
142
|
+
line-height: 1.3;
|
|
143
|
+
.caption {
|
|
144
|
+
margin-bottom: 0;
|
|
145
|
+
margin-top: 0;
|
|
146
|
+
display: inline;
|
|
147
|
+
padding: 0 !important;
|
|
148
|
+
}
|
|
149
|
+
@media @max-text-width {
|
|
150
|
+
padding: 0;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
.side-by-side-caption-left {
|
|
154
|
+
&::before{
|
|
155
|
+
content: "LEFT: ";
|
|
156
|
+
font-family: @sans;
|
|
157
|
+
font-size: @s14;
|
|
158
|
+
font-weight: 700;
|
|
159
|
+
color: @grey-75;
|
|
160
|
+
}
|
|
161
|
+
@media @tablet{
|
|
162
|
+
&::before{
|
|
163
|
+
content: "TOP: ";
|
|
164
|
+
font-family: @sans;
|
|
165
|
+
font-size: @s14;
|
|
166
|
+
font-weight: 700;
|
|
167
|
+
color: @grey-75;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
.side-by-side-caption-right {
|
|
172
|
+
&::before{
|
|
173
|
+
content: " RIGHT: ";
|
|
174
|
+
font-family: @sans;
|
|
175
|
+
font-size: @s14;
|
|
176
|
+
font-weight: 700;
|
|
177
|
+
color: @grey-50;
|
|
178
|
+
}
|
|
179
|
+
@media @tablet{
|
|
180
|
+
&::before{
|
|
181
|
+
content: " BOTTOM: ";
|
|
182
|
+
font-family: @sans;
|
|
183
|
+
font-size: @s14;
|
|
184
|
+
font-weight: 700;
|
|
185
|
+
color: @grey-50;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
//custom graphic
|
|
102
191
|
.graphic-wrapper {
|
|
103
192
|
&.inline-figure.wide, &.inline-figure.full, &.inline-figure.large {
|
|
104
193
|
.caption {
|
|
@@ -128,6 +217,7 @@ h1 {
|
|
|
128
217
|
}
|
|
129
218
|
}
|
|
130
219
|
}
|
|
220
|
+
|
|
131
221
|
a {
|
|
132
222
|
color: @black;
|
|
133
223
|
text-decoration: underline;
|
|
@@ -156,4 +246,11 @@ a {
|
|
|
156
246
|
height: 0.75rem;
|
|
157
247
|
margin-left: @s4;
|
|
158
248
|
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
//formatting for bulleted lists
|
|
252
|
+
ul {
|
|
253
|
+
padding-left: 2.2rem;
|
|
254
|
+
&:extend(.text-width);
|
|
255
|
+
margin-bottom: @s24 !important;
|
|
159
256
|
}
|