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

Not to delete other non-hexo directory when do generation #1310

Closed
wudong opened this issue Jun 3, 2015 · 6 comments
Closed

Not to delete other non-hexo directory when do generation #1310

wudong opened this issue Jun 3, 2015 · 6 comments
Milestone

Comments

@wudong
Copy link

wudong commented Jun 3, 2015

I have a Hexo generated site and inside it along within the hexo target directory (/public ) there is a directory called app (/public/app) which contains content that are not generated by hexo.

The problem I have now is that this directory (/public/app) 's content will be deleted whenever I run hexo generate. Is there any configuration to prevent this from happening?

@borisschapira
Copy link
Contributor

@wudong If you put your folder in /source, it will be automaticaly copied to /public every time hexo generate.

@wudong
Copy link
Author

wudong commented Jun 3, 2015

I understand that. but for me the content of /public/app is generated by other gulp task, whose source doesn't really feel fit inside hexo's directory.

@tommy351
Copy link
Member

tommy351 commented Jun 5, 2015

It's impossible currently. Hexo doesn't know what files should be deleted unless it saves the last generation results.

@tommy351 tommy351 added question Needs help in usage feature-request and removed question Needs help in usage labels Jun 5, 2015
@borisschapira
Copy link
Contributor

@wudong can't your gulp task write to source instead of public ? Problem's solved !

@wudong
Copy link
Author

wudong commented Jun 5, 2015

wouldn't it be a nice feature to have? make it much easier to integrate with other stuff. maybe an option in the site config?

@borisschapira Don't really want to mess the source dir with generated code, which shouldn't be in version control as well.

@tommy351 tommy351 added this to the 3.2 milestone Jun 11, 2015
@tommy351 tommy351 mentioned this issue Jun 11, 2015
8 tasks
@arlair
Copy link

arlair commented Nov 24, 2015

I also ran into this where it is deleting gz files I created. Nginx can serve pre-compressed files instead of doing it on the fly.

tommy351 added a commit that referenced this issue Dec 1, 2015
Changes:
- Rewrite Box.
  - Process files during loading file list.
  - Delay file hash check. Use File.changed() to check if file changed.
  - Remove watch delay.
  - Parallel processing.
- Save rendered content in warehouse. It really saves a lot of time.
- Rewrite generate console.
  - Cache rendered content so we don't have to render it again.
  - Load file list from cache. Don't delete other files in public folder. Resolve #1310
  - Remove file stat check.
  - Parallel generating.
- Resolve race conditions.

Known issues:
- Parallel processing and parallel generating may cause race conditions. We have to solve this in warehouse.
- Tests are not updated yet.
@tommy351 tommy351 closed this as completed Dec 5, 2015
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

4 participants