// Configuration object
const CONFIG = {
SINGLE_PAGE: {
SITE_ID: "642338e703a127cc457d7b6b",
LAYOUT: {
ENGLISH: [
{
type: "home_alt",
name: "Home",
id: '6423394f03a127cc457d7c4f'
},
{
type: "redirect",
name: "Meet the Team",
url: "#team"
},
{
type: "redirect",
name: "Services & Solutions",
url: "#services"
},
{
type: "redirect",
name: "Contact",
url: "#contact"
},
{
type: "redirect",
name: "Client Login",
style: "button",
url: "https://manulifewealth.ca/clients/en/sign-in"
}
],
FRENCH: [
{
type: "home_alt",
name: "Accueil",
id: '64f0c97c6ffaf8c435fd70c2'
},
{
type: "redirect",
name: "Notre équipe",
url: "#team"
},
{
type: "redirect",
name: "Services et solutions",
url: "#services"
},
{
type: "redirect",
name: "Contact",
url: "#contact"
},
{
type: "redirect",
name: "Session client",
style: "button",
url: "https://manulifewealth.ca/clients/fr/sign-in"
}
]
}
},
MULTI_PAGE: {
SITE_ID: '5b71917a1cbe736dff66dc27',
LAYOUT: {
ENGLISH: [
{
type: "home_alt",
name: "Home",
id: "5b719261138837295d1d7edf"
},
{
type: "standard",
name: "About Us",
id: "5b719261138837295d1d7ee0",
children: [
{
type: "members",
name: "Your Team",
id: "5b719261138837295d1d7ee1"
},
{
type: "standard",
name: "Our Process",
id: "5b719261138837295d1d7ee5"
},
{
type: "standard",
name: "Testimonials",
id: "61e880e9a96c7436cc507c6f"
},
{
type: "standard",
name: "Referrals",
id: "61e8e39693909a22246d4d11"
}
]
},
{
type: "standard",
name: "Services & Solutions",
id: "5b719261138837295d1d7ee6"
},
{
type: "blog",
name: "Insights & Articles",
id: "61e8e0c893909a22246d49fa"
},
{
type: "standard",
name: "Client Resources",
id: "6298ae2f282cca59a30e8f2e",
children: [
{
type: "standard",
name: "Client Centre",
id: "5b71bb021cbe736dff66e078"
},
{
type: "standard",
name: "Knowledge Centre",
id: "620e6edf1ba9141f550dcba0"
}
]
},
{
type: "standard",
name: "Contact",
id: "5b719261138837295d1d7eef"
},
{
type: "redirect",
name: "Client Login",
url: "https://manulifewealth.ca/clients/en/sign-in"
}
],
FRENCH: [
{
type: "home_alt",
name: "Accueil",
id: "6298af47282cca59a30e8fda"
},
{
type: "standard",
name: "À Propos",
id: "6298b042282cca59a30e925e",
children: [
{
type: "members",
name: "Notre équipe",
id: "6298b046282cca59a30e9260"
},
{
type: "standard",
name: "Nous Processus",
id: "6298b04c282cca59a30e9264"
},
{
type: "standard",
name: "Témoignages",
id: "6298b04e282cca59a30e9267"
},
{
type: "standard",
name: "Recommandations",
id: "6298b050282cca59a30e926b"
}
]
},
{
type: "standard",
name: "Services",
id: "6298b0c9282cca59a30e92b6"
},
{
type: "blog",
name: "Articles",
id: "6298b0cc282cca59a30e92b7"
},
{
type: "standard",
name: "Ressources",
id: "6298b0ce282cca59a30e92b8",
children: [
{
type: "standard",
name: "Centre client",
id: "6298b0db282cca59a30e92be"
},
{
type: "standard",
name: "Centre d'information",
id: "6298b0dd282cca59a30e92c1"
}
]
},
{
type: "standard",
name: "Contact",
id: "6298b0e4282cca59a30e92cd"
},
{
type: "redirect",
name: "Accès du client",
url: "https://manulifewealth.ca/clients/fr/sign-in"
}
]
}
},
SETTINGS: {
REFRESH_AFTER: false,
REMOVE_OTHER_PAGES: true
},
API_BASE: 'https://app.twentyoverten.com'
}
/* ------------------------------------------------------ */
/**
* Helper function to create URL-friendly slugs from page names
* @param {string} name - The page name to convert to a slug
* @returns {string} - URL-friendly slug
*/
function parseSlug(name) {
return name
.toLowerCase()
.replace(/&/g, 'and') // Replace & with 'and'
.replace(/\s+/g, '-') // Replace spaces with hyphens
.replace(/[^a-z0-9-]/g, '') // Remove any other special characters
.replace(/-+/g, '-') // Replace multiple hyphens with single hyphen
.replace(/^-|-$/g, '') // Remove leading/trailing hyphens
}
/**
* Fetch site data by site ID
* @param {string} site_id - The ID of the site to fetch data for
* @returns {Promise