Right. Now that you posted this I vaguely remember having seen the concat method somewhere before.
But since there is an open issue about providing the means to customize the filenames of generated resources, let me tell you that on Windows 10 I have already hit the filename character limit more than once, due to the way that Hugo generates the resources names.
Shorter filenames by default, for Hugo’s generated resources, would be preferable.
Why not use a shorter hash function like SHA-1 to generate them?
P.S. Also I am re-opening the topic for a limited amount of time in case others want to share their way of customizing the filenames.
true, but the browser making the request doesn’t care about the file on disk. It is talking to an httpd server. The server knows about the filename and it doesn’t do cache throttling. As long as all the requests from the browser contain the query with the filename, then Bob’s your uncle.
EDIT#1: I assume it would be quite straightforward to add the logic in the .Permalink methods so it can keep state across a recompile of the static site and update references.
EDIT#2: In fact hugo doesn’t need to do much tracking. If you want to enforce cache-busting, all you have to do is add a query to any url. The browser is forced to make a request anyway. If browsers do it for favicons then I assume they do it for anything. Perhaps add a flag to the url that will instruct hugo to add a hash of the modified date timestamp to the query. hugo has to keep track of last file-modification dates for tracked files.
as much as is practical, identification should be in the hands of the site administration. I don’t understand what is the distinction of hugo being a ‘static’ site generator. It doesn’t do a one off transformation of content. It also keeps a cache between updates to better track changes and increase efficiency. It is still dynamically generating webpages. Instead of doing it at the request of an end user or a cacheing proxy server, it is doing a sweep at the request of site admin.
The process is still very similar and is doing a lot of the same processing. Certainly more dynamic than old-school printing. You cannot get more static than sending a pdf to a printer and getting dead trees in return.
What is wrong with administrators wanting to track published assets by their filename and modified date or any other key that is meaningful to the publisher?
beware that I’m not really tied to this. That said I would like to have simple filenames. I think query part can be jury-rigged as shortcode or partial with some effort.
EDIT: it would be nice to have access to the created date and modified date in the file variables.