-
-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using mounts module breaks the theme #290
Comments
Once I switched to using the mounts module, the website broke. Somehow the theme's static files were all zero bytes in the Hugo's publish directory. See MunifTanjim/minimo#290 To overcome this issue, this commit will add another mounts configuration to mount the theme's static directory as static directory. This has fixed the issue in local machine.
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
mkdir public
hugo server
renders the site properly; however, if you just build the site usinghugo
, all the files underpublic/assets/
are zero byte files. Somehow the files are getting copied over from the theme's static directory to the publish directory (public) as zero byte files.Hugo Static Site Generator v0.74.3/extended linux/amd64
Just to make sure that this not an issue with Hugo and the mounts module usage as shown above, I grabbed the second theme from Hugo themes collection and added the mounts module exactly as shown above and the theme's CSS and JS files were copied properly. I'm thinking this could be something to do with the minimo theme.
The text was updated successfully, but these errors were encountered: