# Differing "Pages" between dev and production

**URL:** <https://discourse.gohugo.io/t/differing-pages-between-dev-and-production/28270>\
**Category:** support\
**Created:** [September 18, 2020, 4:03pm UTC](https://discourse.gohugo.io/t/differing-pages-between-dev-and-production/28270 "2020-09-18T16:03:47Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidsneighbour](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/davidsneighbour/32/24507_2.png) [@davidsneighbour](https://discourse.gohugo.io/u/davidsneighbour)\
**Post date:** [September 18, 2020, 4:03pm UTC](https://discourse.gohugo.io/t/differing-pages-between-dev-and-production/28270/1 "2020-09-18T16:03:47Z")

</div>

I have a weird thing going on between my local `hugo server` and the live site on Netlify. Going to [https://samui-samui.de](https://samui-samui.de) you will see a box on the right side with years of posts. That box (“Archives”) has 2020 to 2005 and the year 0001 (which ends up in a 404 situation). Running `hugo server` locally it will show only 2020 to 2005.

The theme used is at [https://github.com/davidsneighbour/dnb-hugo-garuda](https://github.com/davidsneighbour/dnb-hugo-garuda) and the template in question is probably widget-archive.html:

> <https://github.com/davidsneighbour/dnb-hugo-garuda/blob/master/layouts/partials/sidebar/widget-archive.html>

What would make this difference come up between dev/live?

I set my site repo to public for now if anyone would like to debug it deeper:

> **[davidsneighbour/samui-samui.de](https://github.com/davidsneighbour/samui-samui.de)**
>
> Repository for samui-samui.de. Contribute to davidsneighbour/samui-samui.de development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![divinerites](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/divinerites/32/12625_2.png) [@divinerites](https://discourse.gohugo.io/u/divinerites)\
**Post date:** [September 18, 2020, 4:51pm UTC](https://discourse.gohugo.io/t/differing-pages-between-dev-and-production/28270/2 "2020-09-18T16:51:39Z")

</div>

Yep, strange.  
Do you have same Hugo version in dev and in your netlify.toml ??

```auto
[context.production.environment]
HUGO_VERSION = "0.74.3"

```

[EDIT] Oops. Didn’t see you have repo available.

Can you try removing the `[context.production]` line ?

Just keep `[context.production.environment]`

---

<div class="post-metadata">

**Author:** ![davidsneighbour](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/davidsneighbour/32/24507_2.png) [@davidsneighbour](https://discourse.gohugo.io/u/davidsneighbour)\
**Post date:** [September 18, 2020, 4:55pm UTC](https://discourse.gohugo.io/t/differing-pages-between-dev-and-production/28270/3 "2020-09-18T16:55:13Z")

</div>

> [@divinerites](#):
>
> Just keep `[context.production.environment]`

And keep all other lines? Like

```auto
[context.production]
  TZ = "Asia/Bangkok"
  HUGO_VERSION = "0.75.1"
  HUGO_ENV = "production"
  HUGO_ENABLEGITINFO = "true"

```

---

<div class="post-metadata">

**Author:** ![davidsneighbour](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/davidsneighbour/32/24507_2.png) [@davidsneighbour](https://discourse.gohugo.io/u/davidsneighbour)\
**Post date:** [September 18, 2020, 4:56pm UTC](https://discourse.gohugo.io/t/differing-pages-between-dev-and-production/28270/4 "2020-09-18T16:56:44Z")

</div>

I pushed it to Github… let’s wait and see 🙂 My deploys on Netlify take lot’s of time these days…

---

<div class="post-metadata">

**Author:** ![divinerites](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/divinerites/32/12625_2.png) [@divinerites](https://discourse.gohugo.io/u/divinerites)\
**Post date:** [September 18, 2020, 4:58pm UTC](https://discourse.gohugo.io/t/differing-pages-between-dev-and-production/28270/5 "2020-09-18T16:58:14Z")

</div>

No, something like

```auto
[build.environment]
  PHP_VERSION="7.2"

 [context.production.environment]
    TZ = "Asia/Bangkok"
    HUGO_VERSION = "0.75.1"
    HUGO_ENV = "production"
    HUGO_ENABLEGITINFO = "true"

# https://www.netlify.com/docs/netlify-toml-reference/#post-processing
[build.processing]
  skip_processing = true

```

This is my rock solid for years `netlify.conf`

```auto
[build]
publish = "public"
command = "hugo --minify"
functions = "functions"

[context.production.environment]
HUGO_VERSION = "0.74.3"
HUGO_ENV = "production"
RUBY_VERSION = "2.6.2"
HUGO_ENABLEGITINFO = "true"
TZ = "Europe/Zurich"
# pour "postcss-cli": "^7.1.1"
NODE_VERSION = "12.2.0"

[context.deploy-preview]
command = "hugo --buildFuture -b $DEPLOY_PRIME_URL"

[context.deploy-preview.environment]
HUGO_VERSION = "0.74.3"
RUBY_VERSION = "2.6.2"
HUGO_ENABLEGITINFO = "true"
TZ = "Europe/Zurich"

[context.branch-deploy]
command = "hugo -b $DEPLOY_PRIME_URL"

[context.branch-deploy.environment]
HUGO_VERSION = "0.74.3"
RUBY_VERSION = "2.6.2"
HUGO_ENABLEGITINFO = "true"
TZ = "Europe/Zurich"

[[headers]]
  for = "/images/*"
  [headers.values]
    Cache-Control = "public, max-age=604800, s-maxage=604800"
[[headers]]
  for = "/*.jpg"
  [headers.values]
    Cache-Control = "public, max-age=604800, s-maxage=604800"
[[headers]]
  for = "/*.png"
  [headers.values]
    Cache-Control = "public, max-age=604800, s-maxage=604800"
[[headers]]
  for = "/*.gif"
  [headers.values]
    Cache-Control = "public, max-age=604800, s-maxage=604800"
[[headers]]
  for = "/*.css"
  [headers.values]
    Cache-Control = "public, max-age=604800, s-maxage=604800"
[[headers]]
  for = "/*.js"
  [headers.values]
    Cache-Control = "public, max-age=604800, s-maxage=604800"
[[headers]]
  for = "/fonts/*"
  [headers.values]
    Cache-Control = "public, max-age=604800, s-maxage=604800"

```

---

<div class="post-metadata">

**Author:** ![davidsneighbour](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/davidsneighbour/32/24507_2.png) [@davidsneighbour](https://discourse.gohugo.io/u/davidsneighbour)\
**Post date:** [September 18, 2020, 4:58pm UTC](https://discourse.gohugo.io/t/differing-pages-between-dev-and-production/28270/6 "2020-09-18T16:58:28Z")

</div>

> [@divinerites](#):
>
> [context.production.environment]

Oh wait… the other way around 😉 It’s late 😉

---

<div class="post-metadata">

**Author:** ![davidsneighbour](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/davidsneighbour/32/24507_2.png) [@davidsneighbour](https://discourse.gohugo.io/u/davidsneighbour)\
**Post date:** [September 18, 2020, 5:07pm UTC](https://discourse.gohugo.io/t/differing-pages-between-dev-and-production/28270/7 "2020-09-18T17:07:41Z")

</div>

Hmm. No, same result. I wonder if it’s possible to somehow debug what the partial thinks it has inside of this item.

---

<div class="post-metadata">

**Author:** ![divinerites](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/divinerites/32/12625_2.png) [@divinerites](https://discourse.gohugo.io/u/divinerites)\
**Post date:** [September 18, 2020, 5:09pm UTC](https://discourse.gohugo.io/t/differing-pages-between-dev-and-production/28270/8 "2020-09-18T17:09:05Z")

</div>

And may be as you have url in front matter, one post with a bad date =\> 0001, but “correct” url.  
But it would fail in both case.

---

<div class="post-metadata">

**Author:** ![divinerites](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/divinerites/32/12625_2.png) [@divinerites](https://discourse.gohugo.io/u/divinerites)\
**Post date:** [September 18, 2020, 5:11pm UTC](https://discourse.gohugo.io/t/differing-pages-between-dev-and-production/28270/9 "2020-09-18T17:11:46Z")

</div>

Yes, I was replying this : print the context and some variables while in your partial. Then search generated source code and you’ll get the origing of this 0001.

Do it locally and from netlify

poor man’s debug but efficient

---

<div class="post-metadata">

**Author:** ![davidsneighbour](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/davidsneighbour/32/24507_2.png) [@davidsneighbour](https://discourse.gohugo.io/u/davidsneighbour)\
**Post date:** [September 18, 2020, 5:14pm UTC](https://discourse.gohugo.io/t/differing-pages-between-dev-and-production/28270/10 "2020-09-18T17:14:24Z")

</div>

> [@divinerites](#):
>
> 0001

But shouldn’t that show up locally too? I did a search for 0001 and it turned up nothing. I’ll try a branch deploy on netlify with @kaushalmodi’s debugprint. ([GitHub - kaushalmodi/hugo-debugprint: Hugo "debugprint.html" partial](https://github.com/kaushalmodi/hugo-debugprint))

---

<div class="post-metadata">

**Author:** ![divinerites](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/divinerites/32/12625_2.png) [@divinerites](https://discourse.gohugo.io/u/divinerites)\
**Post date:** [September 18, 2020, 5:19pm UTC](https://discourse.gohugo.io/t/differing-pages-between-dev-and-production/28270/11 "2020-09-18T17:19:16Z")

</div>

> [@davidsneighbour](#):
>
> But shouldn’t that show up locally too?

Yes. Should be.  
This is the fun part 🙂

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [September 18, 2020, 7:15pm UTC](https://discourse.gohugo.io/t/differing-pages-between-dev-and-production/28270/12 "2020-09-18T19:15:54Z")

</div>

`content/posts/2019/_index.md` does not have a date, so its “date” value will be determined by:  
[https://gohugo.io/getting-started/configuration/#configure-dates](https://gohugo.io/getting-started/configuration/#configure-dates)

What happens if you remove this file, or restrict your range to .Site.RegularPages?

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [September 18, 2020, 7:43pm UTC](https://discourse.gohugo.io/t/differing-pages-between-dev-and-production/28270/13 "2020-09-18T19:43:29Z")

</div>

Minimal example:

```auto
git clone --single-branch -b hugo-forum-topic-28270 https://github.com/jmooring/hugo-testing hugo-forum-topic-28270
cd hugo-forum-topic-28270
hugo server

```

---

<div class="post-metadata">

**Author:** ![davidsneighbour](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/davidsneighbour/32/24507_2.png) [@davidsneighbour](https://discourse.gohugo.io/u/davidsneighbour)\
**Post date:** [September 19, 2020, 7:03am UTC](https://discourse.gohugo.io/t/differing-pages-between-dev-and-production/28270/14 "2020-09-19T07:03:44Z")

</div>

> [@jmooring](#):
>
> `content/posts/2019/_index.md` does not have a date

Ah, you are right. That file is not supposed to be there. I removed it and the stray year 0001 A.D. is gone. Thanks 🙂

---

<div class="post-metadata">

**Author:** ![divinerites](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/divinerites/32/12625_2.png) [@divinerites](https://discourse.gohugo.io/u/divinerites)\
**Post date:** [September 19, 2020, 9:30am UTC](https://discourse.gohugo.io/t/differing-pages-between-dev-and-production/28270/15 "2020-09-19T09:30:34Z")

</div>

Cool. but why it doesn’t happen locally **if** you have same hugo version and same command line parameters, remains **ze** question.

---

<div class="post-metadata">

**Author:** ![yaythomas](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/yaythomas/32/12334_2.png) [@yaythomas](https://discourse.gohugo.io/u/yaythomas)\
**Post date:** [September 19, 2020, 9:34am UTC](https://discourse.gohugo.io/t/differing-pages-between-dev-and-production/28270/16 "2020-09-19T09:34:09Z")

</div>

that’s some next level Sherlock Holmesing you did there @jmooring! 😲

---

<div class="post-metadata">

**Author:** ![davidsneighbour](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/davidsneighbour/32/24507_2.png) [@davidsneighbour](https://discourse.gohugo.io/u/davidsneighbour)\
**Post date:** [September 19, 2020, 10:04am UTC](https://discourse.gohugo.io/t/differing-pages-between-dev-and-production/28270/17 "2020-09-19T10:04:13Z")

</div>

Yes, that’s very weird. There must be a difference how Hugo calculates .Site.Pages in dev and production mode

> [@davidsneighbour](#):
>
> ```auto
> {{ range (where .Site.Pages "Section" "posts").GroupByDate "2006" "desc" }}
> 
> ```

---

<div class="post-metadata">

**Author:** ![divinerites](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/divinerites/32/12625_2.png) [@divinerites](https://discourse.gohugo.io/u/divinerites)\
**Post date:** [September 19, 2020, 10:17am UTC](https://discourse.gohugo.io/t/differing-pages-between-dev-and-production/28270/18 "2020-09-19T10:17:04Z")

</div>

mmmmm I guess that’s not possible if same hugo, same command line (minimal option `--gc --cleanDestinationDir`).

There is something different.

---

<div class="post-metadata">

**Author:** ![divinerites](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/divinerites/32/12625_2.png) [@divinerites](https://discourse.gohugo.io/u/divinerites)\
**Post date:** [September 19, 2020, 10:58am UTC](https://discourse.gohugo.io/t/differing-pages-between-dev-and-production/28270/19 "2020-09-19T10:58:56Z")

</div>

Only difference I see is this if your netlify test is not in prod but a branch. Try `skip_processing = true` on branch and see if this happens. But not really a hugo pb.

I (finally) tested locally myself and there is not 0001 atifact either (0.74.3).

```auto
[build.processing]
  skip_processing = true

[context.branch-name.processing]
  skip_processing = false
[context.branch-name.processing.css]
  bundle = true
  minify = true

```

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [September 19, 2020, 11:10am UTC](https://discourse.gohugo.io/t/differing-pages-between-dev-and-production/28270/20 "2020-09-19T11:10:36Z")

</div>

config.toml

```auto
enableGitInfo = false   

```

netlify.toml

```auto
HUGO_ENABLEGITINFO = "true"

```

The environment variable takes precedence over the configuration parameter.

Another difference is the number of CPU’s available during the build. I’m pretty sure there’s a bug here somewhere, but I can’t put my finger on it yet…

[Next page](https://discourse.gohugo.io/t/differing-pages-between-dev-and-production/28270.md?page=2)
