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

Double mounting content into assets does not live reload content changes #12838

Open
jsmolka opened this issue Sep 6, 2024 · 3 comments
Open

Comments

@jsmolka
Copy link

jsmolka commented Sep 6, 2024

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

$ hugo version
hugo v0.134.1-2f89169baa87a9db47e288b60705f4e99e21a945+extended windows/amd64 BuildDate=2024-09-05T10:17:50Z VendorInfo=gohugoio

I am using Windows 10.

Does this issue reproduce with the latest release?

Clone and setup my blog.

git clone https://github.com/jsmolka/blog
cd blog
npm i
hugo server -F -D

Then change the content of any markdown file. Hugo detects the change, but it's not visible in the browser. Even reloading the page doesn't reflect the changes. I doesn't work with Chrome and Firefox. I need to restart hugo to see the changes. I had this issue for a while and stayed on a older hugo version, hoping for the fix. It stopped working when upgrading from v0.122.0 to v0.123.0.

Hope this helps, thanks for the otherwise great library.

@jmooring
Copy link
Member

jmooring commented Sep 6, 2024

This mount is causing the problem:

[[module.mounts]]
source = "content"
target = "assets"

If you remove the above from your site configuration, the rebuild works as expected.

I understand what you're trying to do (make every page resource available as a global resource), but I wouldn't do that.

@jmooring
Copy link
Member

jmooring commented Sep 6, 2024

Failing test:

func TestRebuildIssue12838(t *testing.T) {
	t.Parallel()

	files := `
-- hugo.toml --
disableKinds = ['page','section','rss','sitemap','taxonomy','term']
[[module.mounts]]
source = 'content'
target = 'assets'
-- layouts/index.html --
{{ .Content }}
-- content/_index.md --
foo
	`

	b := hugolib.NewIntegrationTestBuilder(
		hugolib.IntegrationTestConfig{
			T:           t,
			TxtarString: files,
			NeedsOsFS:   true,
			Running:     true,
		}).Build()

	b.AssertFileContent("public/index.html", "foo")

	b.EditFiles("content/_index.md", "bar").Build()

	b.AssertFileContent("public/index.html", "bar")
}

@bep bep changed the title Reloading the page does not show changes Double mounting content into assets does not live reload content changes Sep 6, 2024
@bep bep added this to the Unscheduled milestone Sep 6, 2024
@jsmolka
Copy link
Author

jsmolka commented Sep 7, 2024

Thank you. I can't really remember what I was trying to achieve there, but I removed the mount and everything works again.

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

3 participants