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

Partial Static Sync #1644

Closed
spf13 opened this issue Nov 29, 2015 · 11 comments
Closed

Partial Static Sync #1644

spf13 opened this issue Nov 29, 2015 · 11 comments

Comments

@spf13
Copy link
Contributor

spf13 commented Nov 29, 2015

Today Hugo synchronizes the entire static directory each time a file change is detected. While it only copies the changed file(s), it still goes through the process of evaluating all files on both sides to determine which file needs to be synced. This isn't necessary as we already know what file changed. We should just sync that file.

ffrizzo added a commit to ffrizzo/hugo that referenced this issue Dec 4, 2015
… the flag forceCopyStatic to always copy all static files when a file is changed
ffrizzo added a commit to ffrizzo/hugo that referenced this issue Dec 4, 2015
Update on the watcher copy static to copy only the changed files and add an flag forceSyncStatic to copy all statics always a static is changed

See gohugoio#1644 gohugoio#1559
ffrizzo added a commit to ffrizzo/hugo that referenced this issue Dec 5, 2015
Update on the watcher copy static to copy only the
changed files and add an flag forceSyncStatic to
copy all statics always a static is changed

See gohugoio#1644 gohugoio#1559
ffrizzo added a commit to ffrizzo/hugo that referenced this issue Dec 7, 2015
Update on the watcher copy static to copy only the
changed files and add an flag forceSyncStatic to
copy all statics always a static is changed

See gohugoio#1644 gohugoio#1559
spf13 pushed a commit that referenced this issue Dec 23, 2015
Update on the watcher copy static to copy only the
changed files and add an flag forceSyncStatic to
copy all statics always a static is changed

See #1644 #1559
@anthonyfok
Copy link
Member

Hello @ffrizzo,

Thank you for your contribution, @ffrizzo! But I think I encountered a bug in your current implementation in #1671: the static directory in the theme is not synchronized. It detects that I changed the style.css (which is inside the theme's static/ directory), but it is probably trying to copy it from the wrong place.

@anthonyfok anthonyfok added this to the v0.16 milestone Dec 28, 2015
@ffrizzo
Copy link
Contributor

ffrizzo commented Dec 28, 2015

Hello @anthonyfok ,

I'll take a look on that and I'll submit a new pull request with the fix.

ffrizzo added a commit to ffrizzo/hugo that referenced this issue Jan 2, 2016
Fix watcher copy static theme files for
changed files

See gohugoio#1644 gohugoio#1559
spf13 pushed a commit that referenced this issue Jan 4, 2016
Fix watcher copy static theme files for
changed files

See #1644 #1559
@Skrylar
Copy link

Skrylar commented Feb 17, 2016

On my box, it actually copies a bit more than just the changed file. Every single file is written to the output directory for every single run of hugo, with the exception of those in the static files directory.

@spf13
Copy link
Contributor Author

spf13 commented Feb 18, 2016

@Skrylar can you provide more information about that? Can you paste the output running with --verbose?

@Skrylar
Copy link

Skrylar commented Feb 21, 2016

@spf13

INFO: 2016/02/21 00:08:56 hugo.go:439: Using config file: c:\Dev\Hugotest\config.toml
WARN: 2016/02/21 00:08:56 hugo.go:522: Unable to find Theme Static Directory:
INFO: 2016/02/21 00:08:56 hugo.go:542: c:\Dev\Hugotest\static\ is the only static directory available to sync from
INFO: 2016/02/21 00:08:56 hugo.go:580: syncing static files to c:\Dev\Hugotest\public\
INFO: 2016/02/21 00:08:56 site.go:1275: found taxonomies: map[string]string{"tag":"tags", "category":"categories"}
WARN: 2016/02/21 00:08:56 site.go:1995: Unable to locate layout for 404 page: [404.html]
WARN: 2016/02/21 00:08:56 site.go:1971: "404.html" is rendered empty
0 draft content
0 future content
10 pages created
0 non-page files copied
0 paginator pages created
0 tags created
0 categories created
in 31 ms

If I force the cache directory to be somewhere (ex. in the "cache" folder of the same directory), no files are left behind there. I'm not sure if that's intended or a symptom.

@bep bep modified the milestones: future, v0.16 May 7, 2016
@jdevoo
Copy link

jdevoo commented May 24, 2016

I just wanted to contribute an issue with the static folder not showing the contributed files from the theme on a Windows machine. My post on the forum here.
When I create the css and img folders manually, the content is correctly added. I thought I would mention this under partial static sync.

@bep
Copy link
Member

bep commented Jul 1, 2017

This issue has been automatically marked as stale because it has not been commented on for at least six months.

The resources of the Hugo team are limited, and so we are asking for your help.

If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.

This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

@bep bep added the Stale label Jul 1, 2017
@jdevoo
Copy link

jdevoo commented Jul 1, 2017

@bep I had indicated on the forum it this had been fixed with 0.17 DEV
Forgot to update here.

@bep bep added Keep and removed Stale labels Jul 1, 2017
@bep
Copy link
Member

bep commented Jul 1, 2017

@jdevoo this issue isn't really about your problem.

@bep
Copy link
Member

bep commented Jul 1, 2017

But then again, I'm pretty sure that this "syncing issue" described in the first post also should be fixed now, by what I can read in the code and by testing; we only sync the path matching the change event(s). Can you confirm, @spf13 ?

tychoish pushed a commit to tychoish/hugo that referenced this issue Aug 13, 2017
Update on the watcher copy static to copy only the
changed files and add an flag forceSyncStatic to
copy all statics always a static is changed

See gohugoio#1644 gohugoio#1559
tychoish pushed a commit to tychoish/hugo that referenced this issue Aug 13, 2017
Fix watcher copy static theme files for
changed files

See gohugoio#1644 gohugoio#1559
@bep bep closed this as completed Nov 27, 2017
@github-actions
Copy link

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 12, 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

7 participants