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

zola serve: option to store html files on disk. #2377

Closed
ppom0 opened this issue Dec 18, 2023 · 4 comments
Closed

zola serve: option to store html files on disk. #2377

ppom0 opened this issue Dec 18, 2023 · 4 comments

Comments

@ppom0
Copy link

ppom0 commented Dec 18, 2023

I'm using TailwindCSS as a CSS framework. It generates CSS classes definitions from the CSS classes present in the HTML.

If I configure TailwindCSS to look after the templates folder, it works fine. I use tailwindcss --watch, which generated its CSS to the static folder, and zola serve, which put assets in the public folder.

But when the CSS class names are dynamically generated by Zola macros, they're not present in the templates folder: only in the public folder, where generated HTML files live.

Problem is: only zola build actually write those files, zola serve store them in-memory, thus making them inaccessible to tailwindcss. It would be super useful to store to have an option like --html-on-disk to the serve subcommand for those kinds of workflows.

ppom0 added a commit to ppom0/zola that referenced this issue Dec 18, 2023
@ppom0
Copy link
Author

ppom0 commented Dec 18, 2023

@n-tux-tmp
Copy link
Contributor

That would be a really awesome feature to have. Would you mind creating a PR with the current Zola version?
Maybe it’ll be easier for Keats to review it…

@Keats
Copy link
Collaborator

Keats commented Dec 23, 2024

Yes you can do a PR for review. I think it's fine to add although keep in mind it's going to be slower than the current approach

@ppom0
Copy link
Author

ppom0 commented Dec 23, 2024

Great! I'll update the patch and open the PR in the following days

ppom0 added a commit to ppom0/zola that referenced this issue Dec 27, 2024
ppom0 added a commit to ppom0/zola that referenced this issue Dec 27, 2024
ppom0 added a commit to ppom0/zola that referenced this issue Dec 27, 2024
ppom0 added a commit to ppom0/zola that referenced this issue Dec 27, 2024
Keats added a commit that referenced this issue Jan 9, 2025
* Implement zola serve --store-html

Fixes #2377

* Apply maintainer suggestions

* fix tests

---------

Co-authored-by: Vincent Prouillet <balthek@gmail.com>
@ppom0 ppom0 closed this as completed Jan 13, 2025
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

3 participants