How to use the datocms-client.Site function in datocms-client

To help you get started, we’ve selected a few datocms-client examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github datocms / gatsby-source-datocms / src / createSiteNode.js View on Github external
module.exports = function(repo, itemsRepo, createNode) {
  const siteEntity = repo.findEntitiesOfType('site')[0];
  const site = new Site(siteEntity, itemsRepo);

  i18n.availableLocales = site.locales;

  site.locales.forEach(locale => {
    i18n.locale = locale;

    let node = initNodeFromEntity(siteEntity, locale);

    node = objectAssign(site.toMap(), node);

    delete node.favicon;
    delete node.faviconMetaTags;

    if (site.favicon) {
      node.faviconMetaTags___NODE = createFaviconMetaTagsNode(
        node,