hugo
hugo copied to clipboard
hugo server does not update tags
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
I am unable to reproduce the problem.
https://user-images.githubusercontent.com/335669/154813527-44af87ca-d262-4a1f-908e-c6bfd8a9a777.mp4
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
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 }}
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.RegularPagessite.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/fooin your browser- :+1: page exists
- move the page
content/news/foo.mdtocontent/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- :+1: page exists
- go back to
localhost:1313/news/foo- :-1: 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:1313in browser- :+1: lists show OK
rm -r content/tags/foo- refresh
localhost:1313- :-1: all lists are empty
- but
hugo serveris still running
- restart
hugo server- :+1: all pages show as expected
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"