Open lobopraveen opened 4 years ago
Can't reproduce 🤔 Which hugo version are you using? @lobopraveen
I tried the same steps now and it worked. So to recreate what I was trying to do, I created the public directory before step 4 and I'm able to reproduce the issue. I will update the steps.
While trying to recreate I tried again with hugo-theme-codex theme. It works even when I follow the exact same steps .
I ran into something strange. In hugo-theme-codex, after followed the steps, I just deleted the about css files under public/css and ran hugo command, it recreated the file but it was a zero byte file. I reran hugo command and the file went from zero byte to the correct file with 4.7kB. I randomly started deleting the css and js file and running hugo without any change and the result was not consistent. Some times the file would reappear as zero byte and then proper size and sometimes it would just take couple of more retries of hugo command. Sometimes it would come right back on first try.
I think this is because of the circular dependency! Hugo command creates the site files and puts them in the public directory amd the static directory gets copied to the public directory as well. Now that the public directory is also mounted as the static, I'm guessing that it creates some kind of circular dependency or infinite loop and the result random.
The surprising thing is that the behavior in minimo theme is consistent. It just creates zero byte files and doesn't flip back even when I run the hugo command back to back a dozen times.
I just assumed that
You may close this if you don't see any issue in your theme. It probably needs an answer from the Hugo developers.
Steps to reproduce
git clone https://github.com/MunifTanjim/minimo.git
cd minimo/exampleSite
[module] [[module.mounts]] source = "public" target = "static"