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

Feature Request: Path to Current config.toml and/or CLI Arguments available within Tera #2647

Open
stellarpower opened this issue Sep 21, 2024 · 0 comments

Comments

@stellarpower
Copy link

Feature Request

I am serving a version of my site for users to view, with additional safety checks, menus and pages that won't be published, and also some debug helpers for me to try and facilitate resolving any issues. I thus have two config files knocked up by a script if the base config changes, and it seems others also use separate configs for deployment.

I include the current page's metadata, as well as the site config, in a debug window so that I can more easily see what Zola has finally seen when rendering the current page, when serving live. This is very useful when there are bits of front matter missing or other situations where something is null and the engine has wiped out the relevant parts of the output HTML. It'd be helpful for debugging purposes to be able to include the path to the current config in there so that I can sanity-check what file is being used.

However, currently we have mode inserted into the config to tell us how zola was launched. Therefore, if this is already a feature, it might make sense to be able to access all of the CLI arguments within the Tera templates, similarly for the purpose of verification and debugging (Don't use these to alter your site!!!). A list would be a start, although if there's some sort of hash used internally that can be exposed easily then I think this would of course be much better (e.g. {drafts: false} is better to index into than iterating over a list looking for --drafts and trying to parse the next item. But that's still an option and at least canonical.

Thanks

Environment

Zola version: 0.19.2

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