Hi I am fairly new to Hugo, loving it, but still in a learning mode.
hugo env:
hugo v0.126.2+extended linux/amd64 BuildDate=2024-07-18T00:00:00+00:00 VendorInfo=Fedora:0.126.2-3.fc41
GOOS=“linux”
GOARCH=“amd64”
GOVERSION=“go1.23rc1”
github.com/sass/libsass=“3.6.5”
github.com/webmproject/libwebp=“v1.3.2”
I use
hugo server -D --disableFastRender
to generate a site.
I noticed the following:
I installed a theme using
hugo new theme THEMENAME
This theme has some sample post folders and files under the /themes/themename/content/posts/ directory.
When I deleted this /themes/themename/content/posts/ directory, the posts still appear in /public.
So far, I have only learned to exit the server using Ctrl-C and restarting it, to try and re-generate the site. Doing this, in this case, does not remove the /posts directory in the public folder.
It is easy of course to manually delete the /posts directory in the public folder, but I am wondering if there is some regeneration command that I should be using instead?
I searched the forum and did not find any issues that I thought was similar.
I looked thru the server options and did not see any that I thought would help with this issue. But I am a noob so maybe I do not understand all the options.
I also did an interwebs search and did not find anything.
Also, I wanted to change the number of words in the summaries in list.html.
I put
summary = 10
in the site’s hugo.toml and the site was automatically regenerated and showed very shortened summaries.
Then I removed this line from the site’s hugo.toml and put it in the theme’s hugo.toml.
This did not work - the summaries were not shortened from the default of 70.
I concluded from this that
summary = 10
can only be but in site’s hugo.toml.
So I removed it from the theme’s hugo.toml and put it back in the site’s hugo.toml.
This time however, the summaries were not shortened, even though this line worked before.
Now, since this line did not work in the site’s hugo.toml, I wonder if my conclusion that this line does not work in the theme’s hugo.toml is incorrect. IE this line is now not working in either file.
Again I exit the server using Ctrl-C and restarting it, to try and re-generate the site but this did not help.
I also have had this issue occasionally when making some other changes in other files.
I did find:
Why isn’t Hugo’s development server detecting file changes?
In its default configuration, Hugo’s file watcher may not be able detect file changes when:Running Hugo within Windows Subsystem for Linux (WSL/WSL2) with project files on a Windows partition Running Hugo locally with project files on a removable drive Running Hugo locally with project files on a storage server accessed via the NFS, SMB, or CIFS protocols In these cases, instead of monitoring native file system events, use the --poll command line flag. For example, to poll the project files every 700 milliseconds, use --poll 700ms.
In the FAQ - those situations do not apply to me but I did try:
hugo server -D --disableFastRender --poll 5000ms
but this did not help either.
So again I am wondering what I am doing wrong, eg is there some re-generation command that I should be using.
Any help is much appreciated