I get the following error when trying to build a hugo project - file name too long
I have set the configuration so that the title is part of the url (and by extension the filename when files generated via build).
Now, I’m not sure whether hugo has a character limit for filenames. Or is it a system one.
I suspect it might not even be the length of the title. Some of the titles have periods for figures (e.g. 1.2 million). Does that throw the build process off? Maybe because period is a reserved character for url paths?
Just wanted to know if there was a character limit for titles in Hugo. And if so, how to handle it (e.g. can we just tell hugo to cut if off at the limit rather than give an error)?
Which part of the code would you like? In the config.toml, the permalinks are set in the following way
[permalinks]
posts = "/:year/:month/:day/:title"
And here is an example of error and title that is too long -
public/2019/05/07/study-finds-global-action-needed-to-ensure-acceptable-climate-futures-researchers-studied-population-growth-the-cost-of-carbon-free-technologies-and-the-climates-sensitivity-to-greenhouse-gas-emissionsand-examined-52-million-future-samples-from-these-uncertainties/index.html: file name too long
Thanks @bep! That actually seems quite sensible! I will do just that.
Could be a nice feature for hugo to programatically generate a short version of the title as slug but that may perhaps be too much to ask for. I’m sure you have a lot on your plate already.