I’m using Hugo + GitHub to deploy to Netlify. I noticed that a directory beginning with a period has not been deployed:
When I generate the site on my local machine with Hugo, the directory is there. But when it’s published by Netlify, the directory is not there (I downloaded the published content and confirm that the directory was not published).
My site name:
My GitHub repo:
Is it possible to publish a directory beginning with a period?
Dot files/directories are ignored
( You can get around this by creating a rewrite as outlined in this post e.g.
@Isabella. Actually there is a workaround, for the folders starting with a dot being ignored as well. The workaround is to use the redirect to “add” the dot back to the beginning of the path.
This works as follows.
Instead of making the directory .well_known/ make it just well_known without the preceeding . character.
Then make a redirect rule like so:
/.well_known/* /well_known/:splat 200
With that rule, you can upload the file as /well_known/something_here but successfully request th…
@coelmay, thank you! This is how I solved, based on your suggestion:
First, on netlify.toml, I appended the mv command after the hugo build command, to rename the directory from “.net-framework” to “net-framework” (without the dot)
command = "hugo --gc --minify && mv public/tags/.net-framework/ public/tags/net-framework/"
This ensures that the content of “net-framework” is published by Netlify.
Then, I added a redirect rule on netlify.toml:
from = "/tags/.net-framework/"
to = "/tags/net-framework/"
status = 200
This way, when someone access the path with the dot, he is redirected to the path without the dot where the content can be found!
Thanks a lot!