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 refresh page when using resources.Concat #12017

Closed
jmooring opened this issue Feb 8, 2024 · 4 comments · Fixed by #12021
Closed

hugo server does not refresh page when using resources.Concat #12017

jmooring opened this issue Feb 8, 2024 · 4 comments · Fixed by #12021
Assignees
Milestone

Comments

@jmooring
Copy link
Member

jmooring commented Feb 8, 2024

Reference: https://discourse.gohugo.io/t/48181

I am convinced this is related to resources.Concat. The test case worked in v0.122.0. Git bisect says 7285e74 is the first "bad" commit, but that isn't terribly helpful.

Setup

assets/
└── a.css

layouts/partials/css.html

{{ $styles := slice }}
{{ range resources.Match "*.css" }}
  {{ $styles = $styles | append . }}
{{ end }}

{{ with resources.Concat "styles.css" $styles }}
  <link rel="stylesheet" href="{{ .RelPermalink }}">
{{ end }}

layouts/index.html

<head>
  ...
  {{ partial "css.html" . }}
  ...
</head>

The test case only has one CSS file, but the number of files concatenated is irrelevant.

Example

git clone --single-branch -b hugo-forum-topic-48181 https://github.com/jmooring/hugo-testing hugo-forum-topic-48181
cd hugo-forum-topic-48181
hugo server

Then modify assets/a.css while the server is running. The page does not refresh.

@bep bep self-assigned this Feb 9, 2024
@bep bep removed the NeedsTriage label Feb 9, 2024
@bep bep added this to the v0.123.0 milestone Feb 9, 2024
bep added a commit that referenced this issue Feb 9, 2024
bep added a commit that referenced this issue Feb 10, 2024
bep added a commit that referenced this issue Feb 10, 2024
bep added a commit that referenced this issue Feb 11, 2024
bep added a commit that referenced this issue Feb 11, 2024
@bep
Copy link
Member

bep commented Feb 13, 2024

OK, I have now found the root cause of this issue, which I'm going to fix tomorrow.

@TiGR
Copy link

TiGR commented Feb 14, 2024

I also get the issue with hugo not updating in server mode when I edit translation files. Not sure if it is related and if I should post it as a separate issue.

For me it happens in the situation where original language page file is in markdown, but translations are in html. And when I edit html translation file (page content, title or anything in the front matter) hugo notices the change, runs rebuild, but nothing changes in render. Using build 21d9057.

@jmooring
Copy link
Member Author

jmooring commented Feb 14, 2024

@TiGR "when I edit translation files" is a separate issue , and nothing new.

Edit: While I've seen this occasionally prior to v0.123.0, I am seeing it consistently with v0.123.0-DEV-21d9057d. See #12039.

bep added a commit to bep/hugo that referenced this issue Feb 16, 2024
bep added a commit that referenced this issue Feb 16, 2024
bep added a commit that referenced this issue Feb 16, 2024
bep added a commit that referenced this issue Feb 16, 2024
bep added a commit that referenced this issue Feb 16, 2024
Copy link

github-actions bot commented Mar 9, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants