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

[BUG] Iteration files probably don't have access to the main data files due to how render() works #7

Open
tycrek opened this issue Oct 12, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@tycrek
Copy link
Owner

tycrek commented Oct 12, 2023

Reference lines:

  • pagery/src/pagery.ts

    Lines 282 to 284 in 2484694

    const render = (file: string, pugFile: string, htmlFile: string, data = userData) =>
    fs.ensureFile(htmlFile)
    .then(() => pug.renderFile(pugFile, { css: _css, data }))
  • Promise.all(files.map((file) => render(file, `${options.views}${file}.pug`, `${options.output}${file}.html`)))
  • pagery/src/pagery.ts

    Lines 303 to 305 in 2484694

    Object.entries(iterData).forEach(([key, data]) => {
    const file = `${source.replace(options.views, '').replace(/\[(.*)\]\.pug/, key)}`;
    iterations.push(render(file, source, `${options.output}${file}.html`, data));
@tycrek tycrek added the bug Something isn't working label Oct 12, 2023
@tycrek tycrek self-assigned this Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant