sfc-utils 1.4.176 → 1.4.178

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/blueconic.js CHANGED
@@ -1,58 +1,134 @@
1
-
2
1
  // Handle returning the right blueconic URL given the domain
3
- let getBlueconic = function(domain){
4
- let blueconicURL = "https://cdn.blueconic.net/hearst.js" // Default, but it's not what we want
5
- let subdomain = ""
2
+ let getBlueconic = function (domain) {
3
+ let blueconicURL = "https://cdn.blueconic.net/hearst.js"; // Default, but it's not what we want
4
+ let subdomain = "";
6
5
 
7
6
  // Set subdomain based on URL
8
- let apex = domain.replace('https://', '')
9
- apex = apex.replace('www.', '')
10
- switch(apex){
11
- case "sfchronicle.com": subdomain = "q777"; break;
12
- case "beaumontenterprise.com": subdomain = "z680"; break;
13
- case "chron.com": subdomain = "u566"; break;
14
- case "ctinsider.com": subdomain = "z492"; break;
15
- case "ctpost.com": subdomain = "t810"; break;
16
- case "darientimes.com": subdomain = "y820"; break;
17
- case "expressnews.com": subdomain = "l936"; break;
18
- case "fairfieldcitizenonline.com": subdomain = "z590"; break;
19
- case "fuelfix.com": subdomain = "z929"; break;
20
- case "greenwichtime.com": subdomain = "y900"; break;
21
- case "hearstmediact.com": subdomain = "j158"; break;
22
- case "hearstmediatx.com": subdomain = "f857"; break;
23
- case "houstonchronicle.com": subdomain = "r541"; break;
24
- case "lmtonline.com": subdomain = "l997"; break;
25
- case "middletownpress.com": subdomain = "w982"; break;
26
- case "milfordmirror.com": subdomain = "y752"; break;
27
- case "mrt.com": subdomain = "x822"; break;
28
- case "myplainview.com": subdomain = "u652"; break;
29
- case "mysanantonio.com": subdomain = "d810"; break;
30
- case "ncadvertiser.com": subdomain = "h353"; break;
31
- case "newmilfordspectrum.com": subdomain = "w020"; break;
32
- case "newstimes.com": subdomain = "w740"; break;
33
- case "ourmidland.com": subdomain = "d276"; break;
34
- case "registercitizen.com": subdomain = "j198"; break;
35
- case "seattlepi.com": subdomain = "p593"; break;
36
- case "sfgate.com": subdomain = "u927"; break;
37
- case "sheltonherald.com": subdomain = "f164"; break;
38
- case "stamfordadvocate.com": subdomain = "h559"; break;
39
- case "thehour.com": subdomain = "f775"; break;
40
- case "theintelligencer.com": subdomain = "s232"; break;
41
- case "theridgefieldpress.com": subdomain = "y653"; break;
42
- case "timesunion.com": subdomain = "n730"; break;
43
- case "trumbulltimes.com": subdomain = "o398"; break;
44
- case "westport-news.com": subdomain = "c993"; break;
45
- case "wiltonbulletin.com": subdomain = "t570"; break;
46
- case "yourconroenews.com": subdomain = "z211"; break;
47
- case "nhregister.com": subdomain = "y738"; break;
7
+ let apex = domain.replace("https://", "");
8
+ apex = apex.replace("www.", "");
9
+ switch (apex) {
10
+ case "sfchronicle.com":
11
+ subdomain = "q777";
12
+ break;
13
+ case "beaumontenterprise.com":
14
+ subdomain = "z680";
15
+ break;
16
+ case "chron.com":
17
+ subdomain = "u566";
18
+ break;
19
+ case "ctinsider.com":
20
+ subdomain = "z492";
21
+ break;
22
+ case "ctpost.com":
23
+ subdomain = "t810";
24
+ break;
25
+ case "darientimes.com":
26
+ subdomain = "y820";
27
+ break;
28
+ case "expressnews.com":
29
+ subdomain = "l936";
30
+ break;
31
+ case "fairfieldcitizenonline.com":
32
+ subdomain = "z590";
33
+ break;
34
+ case "fuelfix.com":
35
+ subdomain = "z929";
36
+ break;
37
+ case "greenwichtime.com":
38
+ subdomain = "y900";
39
+ break;
40
+ case "hearstmediact.com":
41
+ subdomain = "j158";
42
+ break;
43
+ case "hearstmediatx.com":
44
+ subdomain = "f857";
45
+ break;
46
+ case "houstonchronicle.com":
47
+ subdomain = "r541";
48
+ break;
49
+ case "lmtonline.com":
50
+ subdomain = "l997";
51
+ break;
52
+ case "middletownpress.com":
53
+ subdomain = "w982";
54
+ break;
55
+ case "milfordmirror.com":
56
+ subdomain = "y752";
57
+ break;
58
+ case "mrt.com":
59
+ subdomain = "x822";
60
+ break;
61
+ case "myplainview.com":
62
+ subdomain = "u652";
63
+ break;
64
+ case "mysanantonio.com":
65
+ subdomain = "d810";
66
+ break;
67
+ case "ncadvertiser.com":
68
+ subdomain = "h353";
69
+ break;
70
+ case "newmilfordspectrum.com":
71
+ subdomain = "w020";
72
+ break;
73
+ case "newstimes.com":
74
+ subdomain = "w740";
75
+ break;
76
+ case "ourmidland.com":
77
+ subdomain = "d276";
78
+ break;
79
+ case "registercitizen.com":
80
+ subdomain = "j198";
81
+ break;
82
+ case "seattlepi.com":
83
+ subdomain = "p593";
84
+ break;
85
+ case "sfgate.com":
86
+ subdomain = "u927";
87
+ break;
88
+ case "sheltonherald.com":
89
+ subdomain = "f164";
90
+ break;
91
+ case "stamfordadvocate.com":
92
+ subdomain = "h559";
93
+ break;
94
+ case "thehour.com":
95
+ subdomain = "f775";
96
+ break;
97
+ case "theintelligencer.com":
98
+ subdomain = "s232";
99
+ break;
100
+ case "theridgefieldpress.com":
101
+ subdomain = "y653";
102
+ break;
103
+ case "timesunion.com":
104
+ subdomain = "n730";
105
+ break;
106
+ case "trumbulltimes.com":
107
+ subdomain = "o398";
108
+ break;
109
+ case "westport-news.com":
110
+ subdomain = "c993";
111
+ break;
112
+ case "wiltonbulletin.com":
113
+ subdomain = "t570";
114
+ break;
115
+ case "yourconroenews.com":
116
+ subdomain = "z211";
117
+ break;
118
+ case "nhregister.com":
119
+ subdomain = "y738";
120
+ break;
121
+ case "statesman.com":
122
+ subdomain = "t235";
123
+ break;
48
124
  }
49
-
125
+
50
126
  // If we found a subdomain, swap in the new script
51
- if (subdomain){
52
- blueconicURL = `https://${subdomain}.${apex}/script.js`
127
+ if (subdomain) {
128
+ blueconicURL = `https://${subdomain}.${apex}/script.js`;
53
129
  }
54
130
 
55
- return blueconicURL
56
- }
131
+ return blueconicURL;
132
+ };
57
133
 
58
- module.exports = { getBlueconic }
134
+ module.exports = { getBlueconic };
package/brands3.js CHANGED
@@ -199,6 +199,23 @@ let getBrands3 = function (market) {
199
199
  siteId: 20,
200
200
  },
201
201
  },
202
+ Austin: {
203
+ styles: {
204
+ "@brand": "#1665CF",
205
+ "@brand-secondary": "#303030",
206
+ },
207
+ attributes: {
208
+ marketPrefix: "statesman",
209
+ siteName: "Austin American-Statesman",
210
+ twitter: "statesman",
211
+ invert: true,
212
+ gaAccount: "UA-1616916-99",
213
+ subscribeLink: "https://subscription.statesman.com/checkout/",
214
+ sailCustomer: "fa8760dbd3762de6fd3247e7362c70af",
215
+ sailSiteName: "statesman",
216
+ siteId: 100,
217
+ },
218
+ },
202
219
  /* Misc */
203
220
  TK: {
204
221
  styles: {
@@ -44,6 +44,7 @@ const Geocoder = ({
44
44
  break;
45
45
  case "Houston":
46
46
  case "SanAntonio":
47
+ case "Austin":
47
48
  filterRegion = "Texas";
48
49
  break;
49
50
  case "Albany":
@@ -121,6 +121,9 @@ const LayoutHelmet = ({
121
121
  // TODO: Fill this in when the sites get swapped
122
122
  } else if (MARKET_KEY === "Midcom") {
123
123
  // TODO: Fill this in when the sites get swapped
124
+ } else if (MARKET_KEY === "Austin") {
125
+ favHref =
126
+ "https://www.statesman.com/sites/statesman/apple-touch-icon-196x196.png";
124
127
  }
125
128
 
126
129
  // Set section with fallback
@@ -33,6 +33,28 @@ const ShareButtons = ({ meta, urlAdd }) => {
33
33
  <div className={shareStyles.wrapper} id="sharebutton-box">
34
34
  {!hideSocial && (
35
35
  <>
36
+ {/* Facebook */}
37
+ <a
38
+ href={`https://www.facebook.com/sharer/sharer.php?u=${meta.MAIN_DOMAIN}%2F${subfolder}${meta.PROJECT.SLUG}%2F${urlAdd}`}
39
+ className={shareStyles.link}
40
+ onClick={facebookClick}
41
+ >
42
+ <svg
43
+ className={shareStyles.svg}
44
+ aria-hidden="true"
45
+ focusable="false"
46
+ data-prefix="fab"
47
+ data-icon="facebook"
48
+ role="img"
49
+ xmlns="http://www.w3.org/2000/svg"
50
+ viewBox="0 0 320 512"
51
+ >
52
+ <path
53
+ fill="currentColor"
54
+ d="M279.14 288l14.22-92.66h-88.91v-60.13c0-25.35 12.42-50.06 52.24-50.06h40.42V6.26S260.43 0 225.36 0c-73.22 0-121.08 44.38-121.08 124.72v70.62H22.89V288h81.39v224h100.17V288z"
55
+ ></path>
56
+ </svg>
57
+ </a>
36
58
  {/* Twitter */}
37
59
  <a
38
60
  href={`https://x.com/intent/post?url=${meta.MAIN_DOMAIN}%2F${subfolder}${meta.PROJECT.SLUG}%2F${urlAdd}&text=${meta.PROJECT.TWITTER_TEXT}`}
@@ -69,26 +91,23 @@ const ShareButtons = ({ meta, urlAdd }) => {
69
91
  />
70
92
  </svg>
71
93
  </a>
72
- {/* Facebook */}
94
+ {/* Bluesky */}
73
95
  <a
74
- href={`https://www.facebook.com/sharer/sharer.php?u=${meta.MAIN_DOMAIN}%2F${subfolder}${meta.PROJECT.SLUG}%2F${urlAdd}`}
96
+ href={`https://bsky.app/intent/compose?text=${meta.PROJECT.TWITTER_TEXT}&url=${meta.MAIN_DOMAIN}%2F${subfolder}${meta.PROJECT.SLUG}%${urlAdd}`}
75
97
  className={shareStyles.link}
76
- onClick={facebookClick}
77
98
  >
78
99
  <svg
79
100
  className={shareStyles.svg}
101
+ data-icon="bluesky"
102
+ role="img"
80
103
  aria-hidden="true"
81
104
  focusable="false"
82
- data-prefix="fab"
83
- data-icon="facebook"
84
- role="img"
85
105
  xmlns="http://www.w3.org/2000/svg"
86
- viewBox="0 0 320 512"
106
+ viewBox="0 0 512 512"
87
107
  >
88
108
  <path
89
- fill="currentColor"
90
- d="M279.14 288l14.22-92.66h-88.91v-60.13c0-25.35 12.42-50.06 52.24-50.06h40.42V6.26S260.43 0 225.36 0c-73.22 0-121.08 44.38-121.08 124.72v70.62H22.89V288h81.39v224h100.17V288z"
91
- ></path>
109
+ data-name="Bluesky Logo"
110
+ fill="currentColor" d="M111.8 62.2C170.2 105.9 233 194.7 256 242.4c23-47.6 85.8-136.4 144.2-180.2c42.1-31.6 110.3-56 110.3 21.8c0 15.5-8.9 130.5-14.1 149.2C478.2 298 412 314.6 353.1 304.5c102.9 17.5 129.1 75.5 72.5 133.5c-107.4 110.2-154.3-27.6-166.3-62.9l0 0c-1.7-4.9-2.6-7.8-3.3-7.8s-1.6 3-3.3 7.8l0 0c-12 35.3-59 173.1-166.3 62.9c-56.5-58-30.4-116 72.5-133.5C100 314.6 33.8 298 15.7 233.1C10.4 214.4 1.5 99.4 1.5 83.9c0-77.8 68.2-53.4 110.3-21.8z"/>
92
111
  </svg>
93
112
  </a>
94
113
  </>
@@ -1,49 +1,55 @@
1
1
  // Add SFC utils
2
2
  const { getBrands3 } = require('../index')
3
3
  const { getSettings } = require('./tempsettings')
4
- const { DateTime } = require('luxon');
4
+ const { DateTime } = require('luxon')
5
5
 
6
6
  let settings = getSettings()
7
7
 
8
8
  let marketKeyArray = [
9
- {"markets": ["SFC"], "zone": "America/Los_Angeles"},
10
- {"markets": ["Houston","SanAntonio","Texcom"], "zone": "America/Chicago"},
11
- {"markets": ["Albany","CT","Midcom"], "zone": "America/New_York"},
9
+ { markets: ['SFC'], zone: 'America/Los_Angeles' },
10
+ {
11
+ markets: ['Houston', 'SanAntonio', 'Texcom', 'Austin'],
12
+ zone: 'America/Chicago',
13
+ },
14
+ { markets: ['Albany', 'CT', 'Midcom'], zone: 'America/New_York' },
12
15
  ]
13
16
 
14
17
  let currentZone
15
18
  // Find the current market in the array
16
- for (let region in marketKeyArray){
19
+ for (let region in marketKeyArray) {
17
20
  let thisRegion = marketKeyArray[region]
18
- if (thisRegion.markets.includes(settings.PROJECT.MARKET_KEY)){
21
+ if (thisRegion.markets.includes(settings.PROJECT.MARKET_KEY)) {
19
22
  currentZone = thisRegion.zone
20
23
  }
21
24
  }
22
25
  // If we don't have a match, that means we have an invalid market key
23
- if (!currentZone){
24
- console.error("Invalid or undefined MARKET_KEY! See the _key_explainer in project-config to see valid values.")
26
+ if (!currentZone) {
27
+ console.error(
28
+ 'Invalid or undefined MARKET_KEY! See the _key_explainer in project-config to see valid values.'
29
+ )
25
30
  process.exit(1)
26
31
  }
27
32
 
28
33
  // Create computer pub and mod dates
29
- const dt = DateTime.fromFormat(
30
- settings.PROJECT.DATE,
31
- 'MMMM d, y h:mm a',
32
- {zone: currentZone}
33
- )
34
+ const dt = DateTime.fromFormat(settings.PROJECT.DATE, 'MMMM d, y h:mm a', {
35
+ zone: currentZone,
36
+ })
34
37
  // Convert date to computer-readable time
35
38
  const computerPubDate = dt.toISO()
36
39
  settings.PROJECT.ISO_PUBDATE = computerPubDate
37
40
 
38
41
  // If MOD_DATE does not exist, set var to pubdate
39
- let computerModDate = ""
40
- if (typeof settings.PROJECT.MOD_DATE !== 'undefined' && settings.PROJECT.MOD_DATE) {
42
+ let computerModDate = ''
43
+ if (
44
+ typeof settings.PROJECT.MOD_DATE !== 'undefined' &&
45
+ settings.PROJECT.MOD_DATE
46
+ ) {
41
47
  const dt2 = DateTime.fromFormat(
42
48
  settings.PROJECT.MOD_DATE,
43
49
  'MMMM d, y h:mm a',
44
- {zone: currentZone}
50
+ { zone: currentZone }
45
51
  )
46
- computerModDate = dt2.toISO()
52
+ computerModDate = dt2.toISO()
47
53
  } else {
48
54
  // Fallback to creation date
49
55
  computerModDate = computerPubDate
@@ -56,9 +62,9 @@ console.log('Current environment: ' + currentEnv)
56
62
 
57
63
  // Handle test prefix
58
64
  // TODO: Once we embrace the new URL, we can delete this check and hardcode /projects
59
- let projectsPrefix = ""
60
- if (settings.PROJECT.SUBFOLDER.toString().indexOf("projects/") === 0){
61
- projectsPrefix = "/projects"
65
+ let projectsPrefix = ''
66
+ if (settings.PROJECT.SUBFOLDER.toString().indexOf('projects/') === 0) {
67
+ projectsPrefix = '/projects'
62
68
  }
63
69
  // Set the path prefix for the given deploy (ignored for dev)
64
70
  let pathPrefix = '/projects/test-proj/' + settings.PROJECT.SLUG
@@ -115,17 +121,17 @@ let plugins = [
115
121
  ]
116
122
 
117
123
  // Enable preact for the prod build
118
- if (currentEnv !== "development"){
119
- plugins.push("gatsby-plugin-preact")
124
+ if (currentEnv !== 'development') {
125
+ plugins.push('gatsby-plugin-preact')
120
126
  }
121
127
 
122
128
  // TK builds get weird redirect loops with htaccess plugin, so don't use it
123
- if (settings.PROJECT.MARKET_KEY !== "TK"){
124
- plugins.push("gatsby-plugin-htaccess")
129
+ if (settings.PROJECT.MARKET_KEY !== 'TK') {
130
+ plugins.push('gatsby-plugin-htaccess')
125
131
  }
126
132
 
127
133
  module.exports = {
128
134
  siteMetadata: settings,
129
135
  pathPrefix: pathPrefix,
130
- plugins: plugins
136
+ plugins: plugins,
131
137
  }