Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output path keep emails folder structre #1417

Open
Frolipon opened this issue Jan 15, 2025 · 0 comments
Open

Output path keep emails folder structre #1417

Frolipon opened this issue Jan 15, 2025 · 0 comments

Comments

@Frolipon
Copy link

  • Maizzle Version: 5.0.0
  • Node.js Version: 22.9.0

Since version 5, I notice a change in the output destination and was wondering if there was I way to change it.

Before ( Maizzle Version: 4.8.9), when launching a build, the destination path contained only the source template HTML.
That allowed us to manage multi-language in only one html file.
For example, in english the config.production_en.js looked like this:

module.exports = {
  language: 'en',
    build: {
      templates: {
        source: 'src/templates/my_project_name',
        destination: {
          path: 'build_  production/my_project_name/en',
        },
      assets: {
        source: 'src/images/my_project_name/en',
        destination: './',
      },
    },
  },
}

and for french, the the config.production_fr.js looked like this:

module.exports = {
  language: 'fr',
    build: {
      templates: {
        source: 'src/templates/my_project_name',
        destination: {
          path: 'build_  production/my_project_name/fr',
        },
      assets: {
        source: 'src/images/my_project_name/fr',
        destination: './',
      },
    },
  },
}

That way, in the build_production folder, we had only one folder with ou project name and inside, one folder for EN and one folder for FR.

build_production/my_project_name/en/email.html
build_production/my_project_name/fr/email.html

But with Maizzle 5, the output path keeps the folder structure no matter what.
So if I have a config.production_en.js like this:

export default {
  language: 'en',
  build: {
    content: ['emails/my_project_name/index.html'],
    static: {
      source: ['images/my_project_name/en/*.*',],
      destination: 'my_project_name/en/emails/my_project_name/',
    },
    output: {
      path: 'build_production/my_project_name/en/',
      extension: 'html',
    },
  },
}

The build email ill be placed in
build_production/my_project_name/en/emails/my_project_name

Which means, if we want to have multiple languages, that we would have:
build_production/my_project_name/en/emails/my_project_name/email.html
build_production/my_project_name/fr/emails/my_project_name/email.html
etc.

Where we would like to have:
build_production/my_project_name/en/email.html
build_production/my_project_name/fr/email.html

Is it possible to remove in the ouput path the folder structure from the emails folder?

The only workaround so far that we have is to create multiple HTML files or to create components, but it is much less practical.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant