Hugo Website Working Properly in Local But Page Not Found On Netlify

Hope your day is going well :slightly_smiling_face: ,

We’re building a website with Hugo. Everything works fine in local. Here is the Github repo.

When I’m running hugo server -D --watch --verbose, I have this as output:

INFO 2019/12/22 00:58:28 Using config file:
Building sites … INFO 2019/12/22 00:58:28 syncing static files to /fr
INFO 2019/12/22 00:58:28 found taxonomies: map[string]string{"tag":"tags"}
INFO 2019/12/22 00:58:28 found taxonomies: map[string]string{"tag":"tags"}
INFO 2019/12/22 00:58:28 syncing static files to /en

                   | FR | EN
+------------------+----+----+
  Pages            | 28 | 28
  Paginator pages  |  0 |  0
  Non-page files   |  0 |  0
  Static files     |  5 |  5
  Processed images |  0 |  0
  Aliases          |  0 |  0
  Sitemaps         |  1 |  1
  Cleaned          |  0 |  0

Total in 71 ms
Watching for changes in /Users/nioperas06/workspace/opensource/PythonBenin.github.io/{content,data,i18n,layouts,static}
Watching for config changes in /Users/nioperas06/workspace/opensource/PythonBenin.github.io/config.toml
Environment: "development"
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at //localhost:1313/ (bind address 127.0.0.1)
Environment: "development"
Web Server is available at //localhost:1314/ (bind address 127.0.0.1)
Press Ctrl+C to stop

But when I deploy the website on Netlify, I have this as result:

Thank’s you for your help :pray:

You’ll need to check the logs from your deployment, I’m guessing via Netlify. That ought to give you more info. :slight_smile:

No error from Netlify logs.

12:57:27 AM: Build ready to start
12:57:30 AM: build-image version: 9cade8af58c2cf3a17a1e9433d2e979149488837
12:57:30 AM: build-image tag: v3.3.5
12:57:30 AM: buildbot version: 2d05064ce3dd2eb95d282a24602ab707dd9581e8
12:57:30 AM: Fetching cached dependencies
12:57:30 AM: Starting to download cache of 100.7MB
12:57:30 AM: Finished downloading cache in 746.385614ms
12:57:30 AM: Starting to extract cache
12:57:33 AM: Finished extracting cache in 3.052080483s
12:57:34 AM: Finished fetching cache in 3.878695802s
12:57:34 AM: Starting to prepare the repo for build
12:57:34 AM: Preparing Git Reference refs/heads/develop
12:57:35 AM: Found Netlify configuration file. Overriding site configuration
12:57:35 AM: Starting build script
12:57:35 AM: Installing dependencies
12:57:35 AM: Started restoring cached node version
12:57:38 AM: Finished restoring cached node version
12:57:39 AM: v10.18.0 is already installed.
12:57:40 AM: Now using node v10.18.0 (npm v6.13.4)
12:57:40 AM: Attempting ruby version 2.6.2, read from environment
12:57:41 AM: Using ruby version 2.6.2
12:57:41 AM: Using PHP version 5.6
12:57:41 AM: Installing Hugo 0.56.3
12:57:42 AM: Hugo Static Site Generator v0.56.3-F637A1EA/extended linux/amd64 BuildDate: 2019-07-31T12:54:46Z
12:57:42 AM: Started restoring cached go cache
12:57:42 AM: Finished restoring cached go cache
12:57:42 AM: unset GOOS;
12:57:42 AM: unset GOARCH;
12:57:42 AM: export GOROOT='/opt/buildhome/.gimme/versions/go1.12.linux.amd64';
12:57:42 AM: export PATH="/opt/buildhome/.gimme/versions/go1.12.linux.amd64/bin:${PATH}";
12:57:42 AM: go version >&2;
12:57:42 AM: export GIMME_ENV='/opt/buildhome/.gimme/env/go1.12.linux.amd64.env';
12:57:42 AM: go version go1.12 linux/amd64
12:57:42 AM: Installing missing commands
12:57:42 AM: Verify run directory
12:57:42 AM: Executing user command: hugo --gc --minify
12:57:42 AM: Building sites …
12:57:42 AM:                    |
12:57:42 AM:  FR | EN
12:57:42 AM: +------------------+----+----+
12:57:42 AM:  Pages            | 28 | 28
12:57:42 AM:   Paginator pages  |  0 |  0
12:57:42 AM:   Non-page files   |  0 |  0
12:57:42 AM:   Static files
12:57:42 AM:  |  5 |  5
12:57:42 AM:   Processed images
12:57:42 AM: |  0 |  0
12:57:42 AM:   Aliases
12:57:42 AM:  |  0 |  0
12:57:42 AM:   Sitemaps         |  1 |  1
12:57:42 AM:   Cleaned          |  0 |  0
12:57:42 AM: Total in 91 ms
12:57:42 AM: Skipping functions preparation step: no functions directory set
12:57:42 AM: Caching artifacts
12:57:42 AM: Started saving pip cache
12:57:42 AM: Finished saving pip cache
12:57:42 AM: Started saving emacs cask dependencies
12:57:42 AM: Finished saving emacs cask dependencies
12:57:42 AM: Started saving maven dependencies
12:57:42 AM: Finished saving maven dependencies
12:57:42 AM: Started saving boot dependencies
12:57:42 AM: Finished saving boot dependencies
12:57:42 AM: Started saving go dependencies
12:57:42 AM: Finished saving go dependencies
12:57:42 AM: Build script success
12:57:42 AM: Starting to deploy site from 'public'
12:57:42 AM: Creating deploy tree 
12:57:42 AM: 2 new files to upload
12:57:42 AM: 0 new functions to upload
12:57:43 AM: Starting post processing
12:57:43 AM: Post processing done
12:57:43 AM: Site is live
12:57:59 AM: Finished processing build request in 29.453513521s

You’ll need to share the live site. Are all the pages missing, or just specific pages?

Yeah, the live site is available here. All the pages are missing.

All the pages aren’t missing.

The Netlify log says 28 pages are built (along with 5 static pages). You can see some of them https://optimistic-wilson-167567.netlify.com/fr/ and https://optimistic-wilson-167567.netlify.com/en/

I haven’t had experience with multi-lingual sites…but it seems strange to me that you’ve got baseURL set to / in all three spots in https://github.com/PythonBenin/PythonBenin.github.io/blob/develop/config.toml.

The docs you want are:

It seems you only need to specify baseURL for different languages if you’re planning on serving them from different domains. The easier solution is to have each language running from a subdirectory, and if you’re doing that, I don’t think you need to set baseURL for each language.

2 Likes

Yeah you’re right, thank you for your help :grinning:

Happy Christmas :evergreen_tree: