custom_modules/sitemap-generate.js
/**
 * Get URL path for every service for provided category
 * @param servicesData
 * @param categoryName
 * @returns {*}
 */
Get URL path for every service for provided category
@param servicesData
@param categoryName
@returns {*}
Get URL path for every service for provided category @param servicesData @param categoryName @returns { * }
function generateCategoryServicesPaths (servicesData, categoryName) {
  return servicesData.reduce(
    (result, service
    ) => {
      const serviceSlug = caseTitleToSnake(service.name)
      const servicePath = `/${categoryName}/${serviceSlug}`
      const serviceVideosData = loadStaticJson(`./static/database/categories/services/videos/${serviceSlug}.json`)
      const serviceVideosPaths = serviceVideosData ? generateServiceVideosPaths(serviceVideosData, servicePath) : []
      return [
        ...result,
        servicePath,
        ...serviceVideosPaths
      ]
    }, [])
}
function generateCategoryServicesPaths ( servicesData , categoryName ) { return servicesData . reduce ( ( result , service ) => { const serviceSlug = caseTitleToSnake ( service . name ) const servicePath = ` ${ categoryName } ${ serviceSlug } ` const serviceVideosData = loadStaticJson ( ` ${ serviceSlug } ` ) const serviceVideosPaths = serviceVideosData ? generateServiceVideosPaths ( serviceVideosData , servicePath ) : [ ] return [ ... result , servicePath , ... serviceVideosPaths ] } , [ ] ) }
Get URL path for every service for provided category
 @param servicesData
 @param categoryName
 @returns {*}
Get URL path for every service for provided category @param servicesData @param categoryName @returns { * }