The live reload does inconsistent work


#1

I opened a previous issue, but I do think my diagnostic was wrong.

Problem is that:

  1. Run hugo server --disableFastRender --ignoreCache --buildDrafts and my index page build OK
  2. Change some content and still render fine
  3. if I change some partial template, the idex page builds wrongly : it shows all the page from the section
  4. Stop hugo
  5. run again hugo (including the changes in 3) and it builds correctly.

If i run hugo, it builds correctly on disk.
So I guess it is something in the reload logic.

Let me know if you want me to test more (I can’t see what I can explore to help)

Tested on 0.40 too (not only 0.40.1)


[closed] 0.40 .1 breaks children shortcode from Docdock theme
#2

Test it in 0.40.2…


#3

Ah … I see … I was suspecting something like that but couldn’t understand the reason.

Will do it ASAP (brew still in 0.40.1) and report here.


#4

Well … don’t know if it is a good or a bad news

  1. 0.40.2 is “worse” because now it renders all the page even on the first load
  2. I downgraded to 0.38 and all in beetwen versions and they all behave like the 0.40.1 : 1rst load = ok, reload = pb.

I have to adapt my code to be compatible with version < 0.38 and to test first version with this problem.


#5

I found this problem also. The children shortcode works fine for me when I generate the HTML on 0.39 and below. If I am running hugo serve in those versions and make a change to the site, the children shortcode also pulls all directories and not just top-level, but I didn’t mind that so much because I didn’t see the problem in the final HTML build.

From 0.40 and up I see the problem in the final HTML build also.


#6

I post the origin for the problem in the other thread too :

children.html shortcode

{{- .Scratch.Set "current" .Page }}
{{- $cpage := (.Scratch.Get "current") }}
{{- .Scratch.Set "pages" $cpage.Pages }}

{{- .Scratch.Get "pages" }} => Pages(0) on 0.39 / Pages(45) for 0.40.2

#7

Shorter version for the problem:

{{ .Page.Pages }} behaves differently in the 2 Hugo versions


#8

According to @bep, the correct behavior is showing all of the children, not just the top-level.

How would you write the shortcode differently to just show the top-level children?


#9

Note that the home page is special in this case. $home.Pages will be the “site’s pages”. So for the home page you may check that eq .Parent $home or something. I’m sure someone else will come up with something better …