The CSV contains products. The quantity and the pricing will be changing from time to time and the respective content files in Hugo will need to be overwritten when needed automatically and not by hand.
Currently I am using the following workaround to first delete and then re-create a file that needs to be updated:
rm content/test/product-sku/index.md && env HUGO_TITLE="product-sku" hugo new "test/product-sku/index.md"
LIke Maiki said, if the products themselves aren’t changing, just the details about the products, you could leave the sku123/index.md files that pulled data from getCVS from a specific template associated with a product kind and the current SKU.
That would avoid the overwriting problem, but not generating or deleting product content pages as they are added or removed.
I’m using some yaml files with Data templates, and it works pretty smoothly. Biggest challenge was working through the data structure of maps and arrays, but I was dealing with potentially unknown keys. In your case with known keys for price, desc, etc, think you’ll find it’s a pretty clean solution.
You could also use an external script to make sure there’s a sku123/index.md file for every entry in the CSV file, which could also delete any that don’t exist. That script could use hugo’s archetype functionality to create the new files if you wanted.
It’s hard to say exactly how hugo will allow for content files to be created from data sources right now, so hard to choose the method that will require the least changes going forward. But the data template functionality isn’t going away, so even if you had to modify or change something that would allow hugo to create the content files as well as fill in the data, it’s probably mostly reusable.