/**
 * DUET ELEVENTY DATA FILE
 */

// Create a random string for cache busting needs
function chr4() {
  return Math.random().toString(16).slice(-4)
}

const githubProject = process.env.DUET_PROJECT_NAME ? process.env.DUET_PROJECT_NAME.toLowerCase() : ""

// Export environment variable and the current version so that
// they can be used on our website.
module.exports = {
  environment: process.env.ELEVENTY_ENV,
  baseHref: process.env.DUET_TOKEN ? `/${githubProject}/${process.env.DUET_TOKEN}` : "",
  version: chr4() + "-" + chr4() + "-" + chr4(),
}
