buoy-config
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -5,13 +5,10 @@ { | ||
"links": [{ | ||
"title": "Writers", | ||
"url": "writers", | ||
"full_path": false | ||
"text": "Writers", | ||
"href": "/writers/" | ||
}, { | ||
"title": "Careers", | ||
"url": "careers", | ||
"full_path": false | ||
"text": "Careers", | ||
"href": "/careers/" | ||
}, { | ||
"title": "Press", | ||
"url": "press", | ||
"full_path": false | ||
"text": "Press", | ||
"href": "/press/" | ||
}] | ||
@@ -21,13 +18,10 @@ }, { | ||
"links": [{ | ||
"title": "Solutions", | ||
"url": "#solutions", | ||
"full_path": false | ||
"text": "Solutions", | ||
"href": "/#solutions" | ||
},{ | ||
"title": "Symptoms A-Z", | ||
"url": "symptoms-a-z", | ||
"full_path": false | ||
"text": "Symptoms A-Z", | ||
"href": "/symptoms-a-z/" | ||
},{ | ||
"title": "Blog", | ||
"url": "current", | ||
"full_path": false | ||
"text": "Blog", | ||
"href": "/current/" | ||
}] | ||
@@ -37,9 +31,7 @@ }, { | ||
"links": [{ | ||
"title": "Support", | ||
"url": "https://help.buoyhealth.com/", | ||
"full_path": true | ||
"text": "Support", | ||
"href": "https://help.buoyhealth.com/" | ||
}, { | ||
"title": "Contact", | ||
"url": "contact", | ||
"full_path": false | ||
"text": "Contact", | ||
"href": "/contact/" | ||
}] | ||
@@ -49,19 +41,15 @@ }], | ||
{ | ||
"title": "Terms", | ||
"url": "terms", | ||
"full_path": false | ||
"text": "Terms", | ||
"href": "/terms/" | ||
}, { | ||
"title": "Privacy", | ||
"url": "privacy", | ||
"full_path": false | ||
"text": "Privacy", | ||
"href": "/privacy/" | ||
}, { | ||
"title": "Cookies", | ||
"url": "cookies", | ||
"full_path": false | ||
"text": "Cookies", | ||
"href": "/cookies/" | ||
}, { | ||
"title": "Editorial", | ||
"url": "editorial", | ||
"full_path": false | ||
"text": "Editorial", | ||
"href": "/editorial/" | ||
} | ||
] | ||
} |
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports.generatePageUrl = exports.generateLink = exports.check_cta_url = exports.getConfig = exports.getBaseUrl = exports.images = exports.navConfig = exports.footerConfig = exports.gdprConfig = undefined; | ||
exports.getAbsoluteUrl = exports.check_cta_url = exports.getConfig = exports.getBaseUrl = exports.images = exports.navConfig = exports.footerConfig = exports.gdprConfig = undefined; | ||
@@ -32,3 +32,2 @@ var _gdpr = require("./configurations/gdpr.json"); | ||
exports.check_cta_url = _utils.check_cta_url; | ||
exports.generateLink = _utils.generateLink; | ||
exports.generatePageUrl = _utils.generatePageUrl; | ||
exports.getAbsoluteUrl = _utils.getAbsoluteUrl; |
@@ -6,3 +6,3 @@ 'use strict'; | ||
}); | ||
exports.generateLink = exports.generatePageUrl = exports.check_cta_url = exports.getConfig = exports.getBaseUrl = exports.images = undefined; | ||
exports.getAbsoluteUrl = exports.check_cta_url = exports.getConfig = exports.getBaseUrl = exports.images = undefined; | ||
@@ -81,20 +81,14 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var generatePageUrl = exports.generatePageUrl = function generatePageUrl(pagePath, baseUrl) { | ||
var pageUrl = baseUrl; | ||
var getAbsoluteUrl = exports.getAbsoluteUrl = function getAbsoluteUrl(url, baseUrl) { | ||
var fullUrl = baseUrl; | ||
if (pagePath) { | ||
pagePath = pagePath.replace('/', ''); | ||
pageUrl += '/' + pagePath + '/'; | ||
} else { | ||
// Home page url | ||
pageUrl += '/'; | ||
if (url) { | ||
// If already an absolute url just return | ||
if (url.indexOf("http") > -1) return url; | ||
fullUrl += '' + url; | ||
} | ||
return pageUrl; | ||
return fullUrl; | ||
}; | ||
var generateLink = exports.generateLink = function generateLink(link, baseUrl) { | ||
return link.full_path ? link.url : '' + generatePageUrl(link.url, baseUrl); | ||
}; | ||
/////////////////////// | ||
@@ -180,14 +174,2 @@ // PRIVATE UTILITIES // | ||
return link; | ||
}; | ||
var getAbsoluteUrl = function getAbsoluteUrl(url, baseUrl) { | ||
var fullUrl = baseUrl; | ||
if (url) { | ||
// If already an absolute url just return | ||
if (url.indexOf("http") > -1) return url; | ||
fullUrl += '' + url; | ||
} | ||
return fullUrl; | ||
}; |
{ | ||
"name": "buoy-config", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Common configuration files for Buoy clients", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -5,13 +5,10 @@ { | ||
"links": [{ | ||
"title": "Writers", | ||
"url": "writers", | ||
"full_path": false | ||
"text": "Writers", | ||
"href": "/writers/" | ||
}, { | ||
"title": "Careers", | ||
"url": "careers", | ||
"full_path": false | ||
"text": "Careers", | ||
"href": "/careers/" | ||
}, { | ||
"title": "Press", | ||
"url": "press", | ||
"full_path": false | ||
"text": "Press", | ||
"href": "/press/" | ||
}] | ||
@@ -21,13 +18,10 @@ }, { | ||
"links": [{ | ||
"title": "Solutions", | ||
"url": "#solutions", | ||
"full_path": false | ||
"text": "Solutions", | ||
"href": "/#solutions" | ||
},{ | ||
"title": "Symptoms A-Z", | ||
"url": "symptoms-a-z", | ||
"full_path": false | ||
"text": "Symptoms A-Z", | ||
"href": "/symptoms-a-z/" | ||
},{ | ||
"title": "Blog", | ||
"url": "current", | ||
"full_path": false | ||
"text": "Blog", | ||
"href": "/current/" | ||
}] | ||
@@ -37,9 +31,7 @@ }, { | ||
"links": [{ | ||
"title": "Support", | ||
"url": "https://help.buoyhealth.com/", | ||
"full_path": true | ||
"text": "Support", | ||
"href": "https://help.buoyhealth.com/" | ||
}, { | ||
"title": "Contact", | ||
"url": "contact", | ||
"full_path": false | ||
"text": "Contact", | ||
"href": "/contact/" | ||
}] | ||
@@ -49,19 +41,15 @@ }], | ||
{ | ||
"title": "Terms", | ||
"url": "terms", | ||
"full_path": false | ||
"text": "Terms", | ||
"href": "/terms/" | ||
}, { | ||
"title": "Privacy", | ||
"url": "privacy", | ||
"full_path": false | ||
"text": "Privacy", | ||
"href": "/privacy/" | ||
}, { | ||
"title": "Cookies", | ||
"url": "cookies", | ||
"full_path": false | ||
"text": "Cookies", | ||
"href": "/cookies/" | ||
}, { | ||
"title": "Editorial", | ||
"url": "editorial", | ||
"full_path": false | ||
"text": "Editorial", | ||
"href": "/editorial/" | ||
} | ||
] | ||
} |
import gdprConfig from "./configurations/gdpr.json" | ||
import navConfig from "./configurations/nav.json" | ||
import footerConfig from "./configurations/footer.json" | ||
import { images, getBaseUrl, getConfig, check_cta_url, generateLink, generatePageUrl } from "./utils"; | ||
import { images, getBaseUrl, getConfig, check_cta_url, getAbsoluteUrl } from "./utils"; | ||
@@ -14,4 +14,3 @@ export { | ||
check_cta_url, | ||
generateLink, | ||
generatePageUrl | ||
getAbsoluteUrl | ||
} |
@@ -69,20 +69,15 @@ import navConfig from "./configurations/nav.json" | ||
export const generatePageUrl = (pagePath, baseUrl) => { | ||
let pageUrl = baseUrl | ||
export const getAbsoluteUrl = (url, baseUrl) => { | ||
let fullUrl = baseUrl | ||
if (pagePath) { | ||
pagePath = pagePath.replace('/', '') | ||
pageUrl += `/${pagePath}/` | ||
} else { | ||
// Home page url | ||
pageUrl += '/' | ||
if (url) { | ||
// If already an absolute url just return | ||
if (url.indexOf("http") > -1) return url | ||
fullUrl += `${url}` | ||
} | ||
return pageUrl | ||
return fullUrl | ||
} | ||
export const generateLink = (link, baseUrl) => | ||
link.full_path ? link.url : `${generatePageUrl(link.url, baseUrl)}` | ||
/////////////////////// | ||
@@ -170,13 +165,1 @@ // PRIVATE UTILITIES // | ||
} | ||
const getAbsoluteUrl = (url, baseUrl) => { | ||
let fullUrl = baseUrl | ||
if (url) { | ||
// If already an absolute url just return | ||
if (url.indexOf("http") > -1) return url | ||
fullUrl += `${url}` | ||
} | ||
return fullUrl | ||
} |
217044
1011