How to replace a GitHub Pages website

Sorry to make this post so long, but I figured it was best to explain everything as clearly as I could.

Overview:

I have a GitHub Pages website that my domain points to. I’m rebuilding the site using a different theme. I have a plan (below) for how to replace the current site with the new site, and I’d like to know if it’s a reasonable plan.

Details:

My current site uses the Basically Basic theme. I downloaded the theme code to my Mac. Now it’s attached to my .githib.io repository, and I’ve been updating it with GitHub Desktop, with no issues. And as I mentioned, my domain points to it.

I’ve just started to rebuild the site using Minimal Mistakes. I downloaded the source for Minimal Mistakes to a new folder, and I’m working on the site locally. I just started - I’m not even done with _config.yml yet. And the folder isn’t associated with a GitHub repository yet.

The Plan:

I’m thinking I can change to the new version of the site like this:

  1. Delete everything in the current local folder except the .git folder.
  2. Copy over the files and folders from the new site folder (excluding .git, if there is one, which there probably won’t be).
  3. Commit all the changes locally.
  4. Push the changes up to my .gitgub.io repository.

Questions:

  • Will this work?
  • I imagine that my domain will still point to the new site, since it’s in the same repository as the old one, right?
  • Is there a better way to do this? Since I’ve just started working on the new version of the site, I could change tactics if there’s a better way.

Thanks!

From your post, it appears that you’re using the theme via “The Repo Fork n Clone” method.
The first step then, is to have a “clone of Minimal Mistakes theme repo” somewhere in your system.

If you’re planning to delete files from your site, then only delete the directories named _layouts, _includes, _sass, _data and assets.

At this point, your working directory will contain just “content” files and some miscellaneous files like .gitignore, CNAME, etc…

You can try out Minimal Mistakes via the steps listed in the Theme’s readme .For example, via the theme-gem.

Thanks for the reply. It sounds like you’re saying two different things. If I use the gem-based theme, then I don’t need to have a clone of Minimal Mistakes on my system, do I?

Oh yeah… My bad.
I left my answer incomplete.

So basically, since you’re hosting your site via GitHub Pages, you’ll need to opt for
“The Remote Theme” method. That method won’t load third-party plugins in GitHub environment. Therefore, you’ll need to pull in the theme’s data files manually.
This is where the theme’s clone comes handy. You can easily copy the data files and config file from the clone location.

LOL, thanks. Thought I was more confused than I am. :stuck_out_tongue:

In my current setup, I actually do use a clone of the repo. Is there a reason why I shouldn’t do this again? What are the advantages of using the remote theme method over using a cloned repo?

Thanks. I really appreciate you helping.

The advantage is the ease in trying out different themes with minimal changes.
You don’t have to delete folders each time you change a theme. Just a few lines of configuration in the config file and front matter if necessary…

Thanks, that makes sense. Although have you seen Minimal Mistakes _config.yml? I don’t think the phrase “a few lines” applies to it. :wink:(Not that I’m complaining - it’s great to have that many options. Still, it’s NOT just a few lines. :stuck_out_tongue:)

Lol yeah, I’ve seen it. :smiley:
Generally speaking, simple themes require just a change in the theme: THEME-GEM-NAME config setting and listing the theme-gem in the Gemfile :wink:

About 90% of the sample _config.yml is commented out and not needed unless you’re straying from the defaults. So to @ashmaroli’s point, only a few lines of config are needed to get you up and running.

Thanks, and I suppose you’re right. It must be some sort of obsession I have to want to fill everything in. Not sure what that’s about. :roll_eyes: