Skip to content
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

hugo server does not update tags #9533

Open
cobber opened this issue Feb 19, 2022 · 5 comments
Open

hugo server does not update tags #9533

cobber opened this issue Feb 19, 2022 · 5 comments

Comments

@cobber
Copy link

cobber commented Feb 19, 2022

What version of Hugo are you using (hugo version)?

hugo v0.93.0-DEV darwin/amd64 BuildDate=unknown

Does this issue reproduce with the latest release?

yes

Description

This may be a duplicate of #8863 "Hugo server detects change but does not update"

I am just getting started with Hugo and migrating my data to markdown.
This means that I am creating lots of new pages with new tags.

Hugo server updates the pages instantly, and the tags are updated in the pages, but the list of tags shown by layouts/_default/terms.html (or more accurately, /tags) is not.

Killing and re-starting hugo server seems to be the only way to get them to update.

Have I missed something?

Thanks

@jmooring
Copy link
Member

I am unable to reproduce the problem.

Screencast.from.02-19-2022.10.07.29.AM.mp4

@cobber
Copy link
Author

cobber commented Feb 20, 2022

hmmm.... nice screen capture!
I can see that it's works for you but not for me :-|
I only get the the "no update" behaviour, reproducibly.

Something must be different!

I've put together a script to create a minimal hugo site in an empty directory, run hugo server, add a few files with tags and check the results with curl.

The script and transcript of the output I get can be found in this github repo

@bep bep modified the milestones: v0.95.0, v0.96.0 Mar 9, 2022
@bep bep modified the milestones: v0.96.0, v0.97.0 Mar 24, 2022
@jmooring
Copy link
Member

I can reproduce the problem when ranging over .Data.Terms in layouts/_default/taxonomy.html. For example:

{{ range .Data.Terms }}
  <h2><a href="{{ .Page.RelPermalink }}">{{ .Page.Title }}</a></h2>
{{ end }}

I cannot reproduce the problem when ranging over .Pages in the same layout:

{{ range .Pages }}
  <h2><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
{{ end }}

@bep bep modified the milestones: v0.97.0, v0.98.0 Apr 13, 2022
@cobber
Copy link
Author

cobber commented Apr 22, 2022

I've been using 0.97.2 for a few days now and can't see any real change to the behaviour (because no changes have happened yet? I'm not complaining, just stating my understanding of the current situation).

Leaning on @jmooring's comment, I'm using a few different ranges in various layout templates:

  • site.RegularPages
  • site.RegularPages.ByPublishDate.Reverse
  • .RegularPages.ByLastmod.Reverse
  • .Data.Terms.Alphabetical
    • this seems to be the only one which is not updating new terms properly
  • .Pages.ByPublishDate.Reverse
  • .Pages.ByLastmod.Reverse

So it seems that this only affects new terms.

However, I noticed that other page updates don't propagate properly either.

Side-note: I hope all of these problems are related and thus don't justify the creation of new issues. If I'm wrong, feel free to split them out.

e.g.

  • create a page content/news/foo.md
  • start hugo server
  • open the page localhost:1313/news/foo in your browser
    • 👍 page exists
  • move the page content/news/foo.md to content/notes/foo.md
    • hugo server shows
    Source changed ".../content/notes/foo.md": CREATE
    Source changed ".../content/news/foo.md": RENAME
    
  • open localhost:1313/notes/foo
    • 👍 page exists
  • go back to localhost:1313/news/foo
    • 👎 still there, even after page refresh

The same is true when a page is just deleted.

At some point I saw the same page listed twice in a listing after a move like this, but I can't reproduce it at the moment (hugo 0.97.2).

⁉️ Instead I seem to have crashed the server by deleting a tag.

Background: I add content/tags/<tag>/_index.md to define special tags and give them subtitles, e.g. I use ddd-acl (title: ACL, subtitle: Anti-Corruption Layer) and fs-acl (title: ACL, subtitle: Access Control List) to distinguish between two different ACL's.

To reproduce the internal crash:

  • create content/news/foo.md
    ---
    title: foo
    tags:
      - foo
    ---
    Hi Foo!
    
  • create content/tags/foo/_index.md
    ---
    title: FOO
    subtitle: a test foo
    ---
    
  • start hugo server
  • open localhost:1313 in browser
    • 👍 lists show OK
  • rm -r content/tags/foo
  • refresh localhost:1313
    • 👎 all lists are empty
    • but hugo server is still running
  • restart hugo server
    • 👍 all pages show as expected

@bep bep modified the milestones: v0.98.0, v0.99.0 Apr 28, 2022
@bep bep modified the milestones: v0.99.0, v0.100.0 May 24, 2022
@bep bep modified the milestones: v0.100.0, v0.101.0 May 31, 2022
@bep bep modified the milestones: v0.101.0, v0.102.0 Jun 16, 2022
@bep bep modified the milestones: v0.102.0, v0.103.0 Aug 28, 2022
@bep bep modified the milestones: v0.103.0, v0.104.0 Sep 15, 2022
@bep bep modified the milestones: v0.104.0, v0.105.0 Sep 23, 2022
@bep bep modified the milestones: v0.105.0, v0.106.0 Oct 26, 2022
@bep bep removed this from the v0.106.0 milestone Nov 18, 2022
@bep bep modified the milestones: v0.112.0, v0.113.0 Apr 15, 2023
@bep bep modified the milestones: v0.113.0, v0.115.0 Jun 13, 2023
@bep bep modified the milestones: v0.115.0, v0.116.0 Jun 30, 2023
@bep bep modified the milestones: v0.116.0, v0.117.0 Aug 1, 2023
@bep bep modified the milestones: v0.117.0, v0.118.0 Aug 30, 2023
@bep bep modified the milestones: v0.118.0, v0.119.0 Sep 15, 2023
@bep bep modified the milestones: v0.119.0, v0.120.0 Oct 5, 2023
@bep bep modified the milestones: v0.120.0, v0.121.0 Oct 31, 2023
@bep bep modified the milestones: v0.121.0, v0.122.0 Dec 6, 2023
@bep bep modified the milestones: v0.122.0, v0.123.0 Jan 27, 2024
@toyo2333
Copy link

with the same problem

when run in localhost (use: hugo server -D) ,if i add a new post with
new tag it will show on the blog list page at the same time,then if i
click that tag,it (tag filter list page) return 404.

until i restart the server(use: hugo server -D),the tag filter list page is OK。

so,new tag need republish and restart the server to work?

--------my new post was added(created) by other editor not by using "hugo new content xxxx"

@bep bep modified the milestones: v0.123.0, v0.124.0 Jan 29, 2024
@bep bep modified the milestones: v0.124.0, v0.125.0 Mar 4, 2024
@bep bep removed the NeedsTriage label Jul 22, 2024
@bep bep modified the milestones: v0.125.0, Unscheduled Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants