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

watch not working on custom output template #13014

Open
razonyang opened this issue Nov 5, 2024 · 3 comments
Open

watch not working on custom output template #13014

razonyang opened this issue Nov 5, 2024 · 3 comments

Comments

@razonyang
Copy link
Contributor

razonyang commented Nov 5, 2024

Reproducer

// hugo.yaml
outputFormats:
  SearchIndex:
    baseName: 'Search'
    isPlainText: true
    mediaType: 'application/json'
    noAlternative: true

outputs:
  home:
    - HTML
    - SearchIndex
// layouts/_default/index.searchindex.json
{{ partial "index.json" . }}
// layouts/partials/index.json
{{ $data := dict
  "version" 1
}}
{{ jsonify $data }}

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

$ hugo version
hugo v0.137.0-59c115813595cba1b1c0e70b867e734992648d1b+extended linux/amd64 BuildDate=2024-11-04T16:04:06Z VendorInfo=gohugoio

Does this issue reproduce with the latest release?

Yes. It was also present in earlier versions, such as 0.128.0.

@bep
Copy link
Member

bep commented Nov 5, 2024

I'm pretty sure the issue title isn't true in general, so it must something ... special.

  • What do you mean by watch? hugo server --watch?
  • Do you have a complete and failing example living somewhere?

@bep bep added the S0 label Nov 5, 2024
@razonyang
Copy link
Contributor Author

  • What do you mean by watch? hugo server --watch?

Yes, hugo server --watch.

  • Do you have a complete and failing example living somewhere?

I just created a testing branch with the code snippets mentioned above.

git clone -b custom-output-watch [email protected]:razonyang/hugo-testing.git hugo-13014

cd hugo-13014

hugo server --watch -p 1111

And then I modified the layouts/partials/index.json, http://localhost:1111/search.json won't re-render until restarting Hugo server.

I can reproduce it on both Linux (as shown in the video I posted) and Windows.

@ibuli
Copy link

ibuli commented Nov 12, 2024

+1 This issue is also happening to me - the changes are not reflecting if change a particular file until we restart the server.
Currently using hugo v0.114.0+extended darwin/arm64 BuildDate=unknown

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