I’m a beginner with Jekyll. I got the theme from a friend. I can able to run using bundle exec Jekyll serve and view the site locally. When I try to change the code and run serve command. It is replacing the code I change to default code. Please help me to fix this. I have wasted a lot of time on this. Thanks in advance.
Are you editing files in the _site
folder? If you are don’t do that.
Jekyll overwrites that entire folder every time the site is built.
Like @mmistakes said, if you edit the _site
folder documents, its not going to be effective as thats the generated pages, not the source used to generate the pages.
Try running jekyll clean
to have it clean up the folders Jekyll creates during jekyll serve
. Anything you edit from that point will not be overwritten. When you then run jekyll serve
after that, it will generate off those changes.
Note: Once you run jekyll serve
it will make the _site
folder, and thus any changes made within that folder will be just like you’re mentioning now, and be overwritten.
Once you run bundle exec jekyll serve
for the first time, add _site
directory to .gitignore
and forget about it.