Hi, I just deployed Hugo site at Netlify. The index page here looks ok but the other pages like this does not seem to render properly. It works on my localhost.
One difference that catches my attention is this line. Why is there chart.js on the page that’s not rendered properly? <link rel='stylesheet' type='text/css' media='all' href='https://d33wubrfki0l68.cloudfront.net/js/adc83b19e793491b1c6ea0fd8b46cd9f32e592fc/{$rootfolder}/assets/js/chart.js'/>
Here’s the deployment log
4:49:05 PM: Build started
4:49:05 PM: Fetching cached dependencies
4:49:06 PM: Starting to download cache of 32.5MB
4:49:06 PM: Finished downloading cache in 441.862835ms
4:49:07 PM: Preparing Git Reference refs/heads/netlify-hugo-version
4:49:10 PM: Found netlify.toml. Overriding site configuration
4:49:11 PM: Running build command: hugo
4:49:14 PM: v6.11.2 is already installed.
4:49:15 PM: Now using node v6.11.2 (npm v3.10.10)
4:49:15 PM: Using version v6.11.2 of node
4:49:15 PM: Using /opt/buildhome/.rvm/gems/ruby-2.4.0
4:49:15 PM: Set ruby from .ruby-version
4:49:15 PM: Started building sites ...
4:49:15 PM: Built site for language en:
0 of 1 draft rendered
4:49:15 PM: 0 future content
0 expired content
4:49:15 PM: 1 pages created
0 non-page files copied
4:49:16 PM: 0 paginator pages created
4:49:16 PM: 5 tags created
4:49:16 PM: 0 categories created
total in 19 ms
4:49:16 PM: Build complete: exit code: 0
4:49:16 PM: Cleaning up docker container
4:49:16 PM: Starting to deploy site from 'public'
4:49:16 PM: Deploying to CDN
4:49:16 PM: Starting deploy of directory /mnt/build-work/buildbot-855617200/repo/public
4:49:17 PM: Going to deploy the 0 required files
4:49:17 PM: Finished deploying directory /mnt/build-work/buildbot-855617200/repo/public
4:49:17 PM: Finished deploying 0 files in 639.391309ms
4:49:17 PM: Starting post processing
4:49:17 PM: Cleaning up the repository
4:49:17 PM: Post processing done
4:49:17 PM: Site is live
4:49:17 PM: Bundling and saving cache
4:49:22 PM: Finished uploading cache in 605.895732ms
4:49:23 PM: Finished processing build request in 17.596443088s
Update: Netlify asked me to disable asset optimization and it works… but I just wonder … as @bep said … something is wrong with my template… and to my suspicion…
I have 2 static folders, first, in /static/ where I store image for archetype posts /static/img and second in /themes/space/static where I store theme’s static files
You’re linking JavaScript as a stylesheet. This should be <script src="…, no?
Also wondering what {$rootfolder} is since that’s not Hugo syntax. Assuming this is just an issue with Netlify’s asset optimization since they are using Cloudfront as part of their CDN for that particular asset, which is a conflict between mime type and type text/css.
Other than that, I don’t see anything wrong with the templating, since you are using your space theme and not overriding anything in the project-level layouts/partials folder…
Update! this is somewhat “enlightening” to me … the trick that works with Netlify’s asset optimization is to put my theme’s css,js,font,images under 1 folder called asset ! with this, Netlify is somehow understand.
As it turns out, the issue appears to be with the html <base> tag, which I’ve just learned causes confusion for Netlify’s postprocessing.
@vinamelody, Looking at the commit you made to move files into an assets folder, I see you also replaced the theme’s header template (which uses a <base> tag) with a new header that doesn’t. I suspect that’s the change that made everything work properly.
I’m having the same issue, using the Victor Hugo template.
This is my repo and this is my site. Homepage CSS worked but project page fails. (currently project pages work because Asset Optimization is off)
Turning off the Asset Optimization fixes the issue. But thats one of the main reasons I’m using Netlify instead of Github pages. I’m only beginning to learn about Gulp and Webpack so I’m suspicious on how the Victor Hugo template is setup. Am I missing something in my webpack.conf.js? (its located in the root of my repo)