/**
 * DUET ELEVENTY CONFIGURATION
 */
module.exports = function (config) {
  // Enable data deep merge https://www.11ty.dev/docs/data-deep-merge/
  config.setDataDeepMerge(true)

  // Change browserSync prefix, auto open browser, and disable UI.
  config.setBrowserSyncConfig({
    logPrefix: "DUET DESIGN SYSTEM",
    open: "local",
    ui: false,
  })

  // Copy static assets to dist on build.
  // You can add more here if and when needed.
  config.addPassthroughCopy("./src/assets")
  config.addPassthroughCopy("./src/js")
  config.addPassthroughCopy("./src/favicon.ico")
  config.addPassthroughCopy("./src/manifest.json")

  return {
    // If your site lives in a different subdirectory, change this.
    // Leading or trailing slashes are all normalized away, so don’t worry about it.
    // If you don’t have a subdirectory, use "" or "/" (they do the same thing)
    // This is only used for URLs (it does not affect your file structure)
    pathPrefix: "/",
    templateFormats: ["md", "njk", "html"],
    markdownTemplateEngine: "njk",
    htmlTemplateEngine: "njk",
    dataTemplateEngine: false,
    passthroughFileCopy: true,
    dir: {
      input: "src",
      includes: "includes",
      data: "data",
      output: "dist",
    },
  }
}
