Does Hugo ignore commented-out data from local data source?

I use Hugo’s data sources to render certain information on the website.

I store a project/data/my_data.toml and I include the information I want Hugo to render later. If I comment-out some data in the toml file (as a proxy to “draft mode”) would Hugo ignore those? Or would they appear somehow in the deployment? For example, I can see that the HTML isn’t rendering those (not even as commented out code) but I am not sure if the file my_data.toml would appear in the deployment?

My concern basically is “I have some data that I don’t want to appear publicly yet”, does commenting out the data in the TOML file prevent Hugo from “leaking” them? My understanding is that Hugo isn’t deploying the raw my_data.toml file anywhere nor it will render commented-out code.

Thanks!

data files are not published.

only used values will be in the rendered pages.

comments in TOML files are stripped when parsing.

ofc your sources need to be private

1 Like