In most cases, you may want to remove the existing files on your FTP server before uploading fresh copies. Nate explains how to do this in the deploy script, as well as how to ignore files you want to keep.
- [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 Hugo side…would stay on your server until you go 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 cleanRemote method.…What I'll do is I'm going to need to call SFTP client…to list the files that are currently on the server.…I'll do return sftp .list.…
We'll tell it to list the remotePathBase,…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 objectList 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 objectList equals objectList.filter…and anything that is not part of something…we'll call ingoredRemoteItems.has obj .name.…
And that'll match against anything in this thing…that we're defining called ignoredRemoteItems.…
- Advantages of static sites
- Installing Hugo and Git
- Creating a new Hugo site
- Building a new website
- Adding posts, pages, and static content
- Publishing your static site
- Deploying via FTP, AWS, and Netlify
Skill Level Beginner
Amazon Web Services Essential Trainingwith Jeff Winesett5h 2m Intermediate
Amazon Web Services: Storage and Data Managementwith Brandon Rich3h 50m Intermediate
1. How Static Sites Work
2. Set Up Hugo
3. Build a Website
4. Prepare for Publishing
5. Deploy via FTP
6. Deploy to AWS
7. Deploy with Netlify
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.