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

Static file sync fails when server rendering to disk #1842

Closed
moorereason opened this issue Feb 11, 2016 · 4 comments
Closed

Static file sync fails when server rendering to disk #1842

moorereason opened this issue Feb 11, 2016 · 4 comments
Assignees
Milestone

Comments

@moorereason
Copy link
Contributor

When running Hugo HEAD as follows:

hugo server --renderToDisk

Changes to static content are not synced to the public folder. Strangely enough, however, hugo detects it and says it's synced. The issue occurs when changing items in the base static directory and also in a theme's static directory.

The issue is not present when rendering to memory.

hugo server --renderToDisk -v
INFO: 2016/02/11 Using config file: /site/config.toml
INFO: 2016/02/11 using a UnionFS for static directory comprised of:
INFO: 2016/02/11 Base: /site/themes/hcgu-v0/static
INFO: 2016/02/11 Overlay: /site/static/
INFO: 2016/02/11 syncing static files to /site/public/
INFO: 2016/02/11 found taxonomies: map[string]string{"category":"categories", "tag":"tags"}
WARN: 2016/02/11 "" is rendered empty
WARN: 2016/02/11 "404.html" is rendered empty
0 draft content
0 future content
4 pages created
0 non-page files copied
0 paginator pages created
0 tags created
0 categories created
in 20 ms
Watching for changes in /site/{data,content,layouts,static,themes}
Serving pages from /site/public
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop
INFO: 2016/02/11 Received System Events: ["/site/themes/hcgu-v0/sass/_layout.scss": WRITE "/site/themes/hcgu-v0/sass/_layout.scss": WRITE "/site/themes/hcgu-v0/static/css/app.css": WRITE "/site/themes/hcgu-v0/static/css/app.css": WRITE "/site/themes/hcgu-v0/sass/_layout.scss": CHMOD]

Static file changes detected
2016-02-11 17:34 -0600
INFO: 2016/02/11 using a UnionFS for static directory comprised of:
INFO: 2016/02/11 Base: /site/themes/hcgu-v0/static
INFO: 2016/02/11 Overlay: /site/static/
Syncing /css/app.css to /site/public/

Change detected, rebuilding site
2016-02-11 17:34 -0600
Template changed /site/themes/hcgu-v0/sass/_layout.scss
WARN: 2016/02/11 "" is rendered empty
WARN: 2016/02/11 "404.html" is rendered empty
0 draft content
0 future content
4 pages created
0 non-page files copied
0 paginator pages created
0 categories created
0 tags created
in 25 ms

In the above example, I'm expecting /site/themes/hcgu-v0/static/css/app.css to be copied into /site/public/css/app.css. I checked md5sums of the file before and after, and the file is unchanged.

@moorereason moorereason added this to the v0.16 milestone Feb 11, 2016
@bep
Copy link
Member

bep commented Feb 15, 2016

I have tested this briefly:

  • this works fine on OS X
  • it doesn't work in Windows
  • in the tests I have been doing it seems that the OS X changes have been a DELETE followed by CREATE, Windows one MODIFY.
  • If you delete the target file it gets synced over

No idea.

@bep
Copy link
Member

bep commented Mar 1, 2016

I see this on OS X also now (I had a old Hugo site with the -d option set and edit CSS on the fly didn't work. Removing the "-d" (destionation => render to mem instead) fixed it.

@bep bep assigned spf13 and bep and unassigned spf13 Mar 1, 2016
@bep
Copy link
Member

bep commented Mar 1, 2016

I have opened up a couple of related Fsync pull requests; the first one fixes this issue.

/cc @spf13

bep added a commit to spf13/fsync that referenced this issue Mar 10, 2016
bep added a commit to spf13/fsync that referenced this issue Mar 10, 2016
@github-actions
Copy link

github-actions bot commented Apr 8, 2022

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 Apr 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants