From the course: Learning Static Site Building with Jekyll
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Remove old files from the server
From the course: Learning Static Site Building with Jekyll
Remove old files from the server
- [Instructor] In most cases, you'll want to remove or clean out your old site files before uploading newly generated files. Without this step, anything you delete on the Jekyll side will stay on your server until you manually delete it. If you only plan on adding content and never removing anything, you could skip this step. I'm going to add some code to the clean remote method. What I'll do is, I'm going to need to call the sftp client to list the files that are currently on the server so I'll do return sftp.list. We'll tell it to list the remote path base, essentially the public html folder and then after that we'll do then. We'll get back a list of objects and we want to act on those objects. So, we'll say object list to a new block of code. There are a few items we'll want to always ignore so let's filter those out. Let's say object list equals objectlist.filter and anything that is not part of something we'll call, ignoredremoteitems.hasobj.name. That'll match against anything…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
(Locked)
Deploy via FTP overview2m 2s
-
(Locked)
Set up Node and npm1m 40s
-
(Locked)
Connect to the server7m 21s
-
(Locked)
Collect the local files4m 51s
-
(Locked)
Remove old files from the server5m 39s
-
(Locked)
Upload the site content2m 43s
-
(Locked)
Deploy via FTP with Travis CI3m 10s
-
(Locked)
FTP next steps1m 2s
-
(Locked)
-
-
-