sfc-utils 1.3.45 → 1.3.47
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/brands.js +1 -0
- package/brands2.js +172 -0
- package/copy/c2p_sheet.js +1 -1
- package/css/nav2.less +2 -2
- package/index.js +14 -13
- package/package.json +1 -1
package/brands.js
CHANGED
|
@@ -11,6 +11,7 @@ let getBrands = function(market){
|
|
|
11
11
|
"@serif-book": '"Lora Light", Georgia, serif',
|
|
12
12
|
"@serif-bold": '"Lora Light", Georgia, serif',
|
|
13
13
|
|
|
14
|
+
"@sans": '"Source Sans Pro Light", Helvetica, sans-serif',
|
|
14
15
|
"@sans-light": '"Source Sans Pro Light", Helvetica, sans-serif',
|
|
15
16
|
"@sans-med": '"Source Sans Pro Regular", Helvetica, sans-serif',
|
|
16
17
|
"@sans-book": '"Source Sans Pro Regular", Helvetica, sans-serif',
|
package/brands2.js
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
|
|
2
|
+
// Set brand object to override CSS based on this market's styles
|
|
3
|
+
let getBrands2 = function(market){
|
|
4
|
+
// We can add any Hearst global overrides here:
|
|
5
|
+
let defaultObj = {
|
|
6
|
+
styles: {
|
|
7
|
+
"@alert-red": "#d20000",
|
|
8
|
+
// Defaults
|
|
9
|
+
"@hed": '"Lora", Georgia, serif',
|
|
10
|
+
"@hed-alt": '"Lora", Georgia, serif',
|
|
11
|
+
"@serif": '"Lora", Georgia, serif',
|
|
12
|
+
"@sans": '"Source Sans Pro", Helvetica, sans-serif',
|
|
13
|
+
"@sans-alt": '"Source Sans Pro", Helvetica, sans-serif',
|
|
14
|
+
|
|
15
|
+
// Icons
|
|
16
|
+
"@sub-icon": `url('data:image/svg+xml, <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="white"><path d="M160 416H96c-17.67 0-32-14.33-32-32V128c0-17.67 14.33-32 32-32h64c17.67 0 32-14.33 32-32S177.7 32 160 32H96C42.98 32 0 74.98 0 128v256c0 53.02 42.98 96 96 96h64c17.67 0 32-14.33 32-32S177.7 416 160 416zM502.6 233.4l-128-128c-12.51-12.51-32.76-12.49-45.25 0c-12.5 12.5-12.5 32.75 0 45.25L402.8 224H192C174.3 224 160 238.3 160 256s14.31 32 32 32h210.8l-73.38 73.38c-12.5 12.5-12.5 32.75 0 45.25s32.75 12.5 45.25 0l128-128C515.1 266.1 515.1 245.9 502.6 233.4z"/></svg>')`,
|
|
17
|
+
},
|
|
18
|
+
attributes: {
|
|
19
|
+
"subscribeLink": "https://www.hearst.com/newspapers?projects=true"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Handle market-specific styles here:
|
|
24
|
+
let marketObj = {
|
|
25
|
+
/* San Franicsco Chronicle */
|
|
26
|
+
SFC: {
|
|
27
|
+
styles: {
|
|
28
|
+
"@brand": "#26A0A5",
|
|
29
|
+
"@brand-secondary": "#FFBC30",
|
|
30
|
+
"@hed": '"Tiempos Headline", Georgia, serif',
|
|
31
|
+
"@hed-alt": '"Tiempos Headline", Georgia, serif',
|
|
32
|
+
"@serif": '"Tiempos", Georgia, serif',
|
|
33
|
+
"@sans": '"National", Helvetica, sans-serif',
|
|
34
|
+
"@sans-alt": '"National", Helvetica, sans-serif'
|
|
35
|
+
},
|
|
36
|
+
attributes: {
|
|
37
|
+
"marketPrefix": "sf",
|
|
38
|
+
"siteName": "The San Francisco Chronicle",
|
|
39
|
+
"twitter": "sfchronicle",
|
|
40
|
+
"gaAccount": "UA-1616916-26",
|
|
41
|
+
"subscribeLink": "https://www.sfchronicle.com/subproject"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
/* Houston Chronicle */
|
|
46
|
+
Houston: {
|
|
47
|
+
styles: {
|
|
48
|
+
"@brand": "#FF7500",
|
|
49
|
+
"@brand-secondary": "#1874CB",
|
|
50
|
+
"@hed": '"Marr Sans", Georgia, serif',
|
|
51
|
+
"@hed-alt": '"Marr Sans Condensed", Georgia, serif',
|
|
52
|
+
"@serif": '"Publico", Georgia, serif',
|
|
53
|
+
"@sans": '"Marr Sans", Helvetica, sans-serif',
|
|
54
|
+
"@sans-alt": '"Marr Sans Condensed", Helvetica, sans-serif'
|
|
55
|
+
},
|
|
56
|
+
attributes: {
|
|
57
|
+
"marketPrefix": "hc",
|
|
58
|
+
"siteName": "The Houston Chronicle",
|
|
59
|
+
"twitter": "HoustonChron",
|
|
60
|
+
"invert": true,
|
|
61
|
+
"gaAccount": "UA-1616916-24",
|
|
62
|
+
"subscribeLink": "https://www.houstonchronicle.com/subproject"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
/* Albany Times Union */
|
|
67
|
+
Albany: {
|
|
68
|
+
styles: {
|
|
69
|
+
"@brand": "#006FBA",
|
|
70
|
+
"@brand-secondary": "#E5A72C",
|
|
71
|
+
"@hed": '"ChronicleDispCond", Georgia, serif',
|
|
72
|
+
"@hed-alt": '"ChronicleDispCond", Georgia, serif',
|
|
73
|
+
"@serif": '"ChronicleText", Georgia, serif',
|
|
74
|
+
"@sans": '"HelveticaNeue", Helvetica, sans-serif',
|
|
75
|
+
"@sans-alt": '"HelveticaNeueCond", Helvetica, sans-serif'
|
|
76
|
+
},
|
|
77
|
+
attributes: {
|
|
78
|
+
"marketPrefix": "tu",
|
|
79
|
+
"siteName": "Times Union",
|
|
80
|
+
"twitter": "timesunion",
|
|
81
|
+
"invert": true,
|
|
82
|
+
"gaAccount": "UA-1616916-7",
|
|
83
|
+
"subscribeLink": "https://www.timesunion.com/subproject"
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
/* San Antonio Express News */
|
|
88
|
+
SanAntonio: {
|
|
89
|
+
styles: {
|
|
90
|
+
"@brand": "#BA142D",
|
|
91
|
+
"@brand-secondary": "#189196"
|
|
92
|
+
},
|
|
93
|
+
attributes: {
|
|
94
|
+
"marketPrefix": "sa",
|
|
95
|
+
"siteName": "Express News",
|
|
96
|
+
"twitter": "ExpressNews",
|
|
97
|
+
"invert": true,
|
|
98
|
+
"gaAccount": "UA-1616916-27",
|
|
99
|
+
"subscribeLink": "https://www.expressnews.com/subproject"
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
|
|
103
|
+
/* Connecticut */
|
|
104
|
+
CT: {
|
|
105
|
+
styles: {
|
|
106
|
+
"@brand": "#1A98FF",
|
|
107
|
+
"@brand-secondary": "#FFBC30"
|
|
108
|
+
},
|
|
109
|
+
attributes: {
|
|
110
|
+
"marketPrefix": "in",
|
|
111
|
+
"siteName": "CTInsider",
|
|
112
|
+
"twitter": "insider_ct",
|
|
113
|
+
"invert": true,
|
|
114
|
+
"gaAccount": "UA-1616916-99",
|
|
115
|
+
"subscribeLink": "https://www.ctinsider.com/subproject"
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
|
|
119
|
+
/* Communities */
|
|
120
|
+
Texcom: {
|
|
121
|
+
styles: {
|
|
122
|
+
"@brand": "#900900",
|
|
123
|
+
"@brand-secondary": "#189196"
|
|
124
|
+
},
|
|
125
|
+
attributes: {
|
|
126
|
+
"marketPrefix": "texcom/mrt",
|
|
127
|
+
"siteName": "Midland Reporter-Telegram",
|
|
128
|
+
"twitter": "mwtnews",
|
|
129
|
+
"invert": true,
|
|
130
|
+
"gaAccount": "UA-1616916-99",
|
|
131
|
+
"subscribeLink": "/subproject"
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
Midcom: {
|
|
135
|
+
styles: {
|
|
136
|
+
"@brand": "#900900",
|
|
137
|
+
"@brand-secondary": "#189196"
|
|
138
|
+
},
|
|
139
|
+
attributes: {
|
|
140
|
+
"marketPrefix": "midcom/mid",
|
|
141
|
+
"siteName": "Midland Daily News",
|
|
142
|
+
"twitter": "MDN",
|
|
143
|
+
"invert": true,
|
|
144
|
+
"gaAccount": "UA-1616916-99",
|
|
145
|
+
"subscribeLink": "/subproject"
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
|
|
149
|
+
/* Misc */
|
|
150
|
+
TK: {
|
|
151
|
+
styles: {
|
|
152
|
+
"@brand": "#900900",
|
|
153
|
+
"@brand-secondary": "#189196"
|
|
154
|
+
},
|
|
155
|
+
attributes: {
|
|
156
|
+
"marketPrefix": "tk",
|
|
157
|
+
"siteName": "Hearst Digital News",
|
|
158
|
+
"twitter": "Hearst",
|
|
159
|
+
"invert": true,
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// Combine global and market styles to return the final object
|
|
165
|
+
let combinedStyles = {
|
|
166
|
+
styles: Object.assign(defaultObj.styles, marketObj[market].styles),
|
|
167
|
+
attributes: Object.assign(defaultObj.attributes, marketObj[market].attributes)
|
|
168
|
+
}
|
|
169
|
+
return combinedStyles
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
module.exports = { getBrands2 }
|
package/copy/c2p_sheet.js
CHANGED
|
@@ -71,7 +71,7 @@ let createSheet = (auth, fallback, configData) => {
|
|
|
71
71
|
//'copyCollaborators': true // This doesn't work unfortunately
|
|
72
72
|
},
|
|
73
73
|
(err, resp) => {
|
|
74
|
-
console.log(resp);
|
|
74
|
+
console.log("SHEET RESP", resp);
|
|
75
75
|
// Make edits to the sheet to match the repo details
|
|
76
76
|
let resources = {
|
|
77
77
|
auth: auth,
|
package/css/nav2.less
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// NOTE: This relies on variables that are updated in
|
|
1
|
+
// NOTE: This relies on variables that are updated in brands2.js
|
|
2
2
|
// Styles for the nav
|
|
3
3
|
.nav2-container {
|
|
4
4
|
width: 100%;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
display: flex;
|
|
8
8
|
justify-content: space-between;
|
|
9
9
|
align-items: center;
|
|
10
|
-
font-family: @sans
|
|
10
|
+
font-family: @sans;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
.nav2-left, .nav2-right {
|
package/index.js
CHANGED
|
@@ -9,15 +9,15 @@ let appCheck = function(){
|
|
|
9
9
|
if (env === 'app'){
|
|
10
10
|
appVersion = true
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
|
|
13
13
|
// If we can access window, check to see if we're dealing with app version
|
|
14
14
|
if (typeof window !== "undefined"){
|
|
15
15
|
// Any link with ?fromRichie=1 will have paywall disabled
|
|
16
16
|
// Also hdnEmployeeAccess is the new free param
|
|
17
17
|
// Native in-app webviews will have a custom user agent, so check that too
|
|
18
18
|
if (
|
|
19
|
-
window.location.href.indexOf('fromRichie=1') > -1 ||
|
|
20
|
-
window.location.href.indexOf('hdnEmployeeAccess=true') > -1 ||
|
|
19
|
+
window.location.href.indexOf('fromRichie=1') > -1 ||
|
|
20
|
+
window.location.href.indexOf('hdnEmployeeAccess=true') > -1 ||
|
|
21
21
|
navigator.userAgent.indexOf(' Richie/') > -1) {
|
|
22
22
|
appVersion = true
|
|
23
23
|
}
|
|
@@ -29,7 +29,7 @@ let appCheck = function(){
|
|
|
29
29
|
// Blend the HDN var with whatever is already present on the page
|
|
30
30
|
// Returns a string for injection into the head of the page
|
|
31
31
|
let blendHDN = function(meta){
|
|
32
|
-
|
|
32
|
+
|
|
33
33
|
if (!meta.PROJECT){
|
|
34
34
|
// If we don't have a properly formatted meta var coming in, this is a legacy template and needs settings pulled
|
|
35
35
|
let url_add = meta.url_add || ""
|
|
@@ -78,7 +78,7 @@ let blendHDN = function(meta){
|
|
|
78
78
|
|
|
79
79
|
// If canonical has a slash at the end, remove it
|
|
80
80
|
if (CANONICAL_URL.slice(-1) === "/"){
|
|
81
|
-
CANONICAL_URL = CANONICAL_URL.slice(0, -1)
|
|
81
|
+
CANONICAL_URL = CANONICAL_URL.slice(0, -1)
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
// Add the url add here unless it's sent in
|
|
@@ -90,7 +90,7 @@ let blendHDN = function(meta){
|
|
|
90
90
|
if (URL_ADD && URL_ADD.slice(-1) !== "/"){
|
|
91
91
|
URL_ADD += "/"
|
|
92
92
|
}
|
|
93
|
-
|
|
93
|
+
|
|
94
94
|
// Get dates from env
|
|
95
95
|
let pubdate = ""
|
|
96
96
|
if (ISO_PUBDATE){
|
|
@@ -143,31 +143,31 @@ let blendHDN = function(meta){
|
|
|
143
143
|
|
|
144
144
|
// HDN.dataLayer object for source information
|
|
145
145
|
HDN.dataLayer.source.authorName = ''
|
|
146
|
-
|
|
146
|
+
|
|
147
147
|
HDN.dataLayer.source.authorTitle = '';
|
|
148
148
|
HDN.dataLayer.source.originalSourceSite = '';
|
|
149
149
|
HDN.dataLayer.source.publishingSite = '';
|
|
150
150
|
HDN.dataLayer.source.sourceSite = '';
|
|
151
151
|
switch(MARKET_KEY){
|
|
152
|
-
case "SFC":
|
|
152
|
+
case "SFC":
|
|
153
153
|
HDN.dataLayer.source.authorTitle = 'San Francisco Chronicle Staff';
|
|
154
154
|
HDN.dataLayer.source.originalSourceSite = 'SF';
|
|
155
155
|
HDN.dataLayer.source.publishingSite = 'premiumsfgate';
|
|
156
156
|
HDN.dataLayer.source.sourceSite = 'sfgate';
|
|
157
157
|
break;
|
|
158
|
-
case "Houston":
|
|
158
|
+
case "Houston":
|
|
159
159
|
HDN.dataLayer.source.authorTitle = 'Houston Chronicle Staff';
|
|
160
160
|
HDN.dataLayer.source.originalSourceSite = 'HC';
|
|
161
161
|
break;
|
|
162
|
-
case "SanAntonio":
|
|
162
|
+
case "SanAntonio":
|
|
163
163
|
HDN.dataLayer.source.authorTitle = 'Express News Staff';
|
|
164
164
|
HDN.dataLayer.source.originalSourceSite = 'EN';
|
|
165
165
|
break;
|
|
166
|
-
case "Albany":
|
|
166
|
+
case "Albany":
|
|
167
167
|
HDN.dataLayer.source.authorTitle = 'Times Union Staff';
|
|
168
168
|
HDN.dataLayer.source.originalSourceSite = 'TU';
|
|
169
169
|
break;
|
|
170
|
-
case "CT":
|
|
170
|
+
case "CT":
|
|
171
171
|
HDN.dataLayer.source.authorTitle = 'Connecticut Digital Staff';
|
|
172
172
|
HDN.dataLayer.source.originalSourceSite = 'CT';
|
|
173
173
|
break;
|
|
@@ -248,6 +248,7 @@ let blendHDN = function(meta){
|
|
|
248
248
|
|
|
249
249
|
// Grab neighbor files
|
|
250
250
|
let { getBrands } = require('./brands')
|
|
251
|
+
let { getBrands2 } = require('./brands2')
|
|
251
252
|
let { getSettings } = require('./settings')
|
|
252
253
|
let { getNav } = require('./nav')
|
|
253
254
|
let { getNav2 } = require('./nav2')
|
|
@@ -257,4 +258,4 @@ let { getTopper } = require('./topper')
|
|
|
257
258
|
let { getBlueconic } = require('./blueconic')
|
|
258
259
|
let { pollForAccount } = require('./accountswap')
|
|
259
260
|
|
|
260
|
-
module.exports = { appCheck, blendHDN, getSettings, getBrands, getNav, getNav2, getSpecialNav, getFooter, getTopper, getBlueconic, pollForAccount }
|
|
261
|
+
module.exports = { appCheck, blendHDN, getSettings, getBrands, getBrands2, getNav, getNav2, getSpecialNav, getFooter, getTopper, getBlueconic, pollForAccount }
|