Skip to content

Editing Moonrise off GitHub

Nightscape Coffee edited this page Jun 12, 2021 · 2 revisions

Questions:
How do I edit Moonrise locally/on my PC?
How do I host Moonrise on a different service?
Why does downloading Moonrise not work?


Moonrise was built with GitHub Pages in mind. This means it doesn't use regular HTML files.

Instead, it uses text files (in Markdown format), which makes editing files on GitHub fast and easy!


What does this mean?

  • You will be editing regular text files (in Markdown format) from the GitHub website
  • You will need to process these text files using Jekyll to get HTML files
    • GitHub does this automatically
  • The processed HTML files need to be hosted at a domain (such as example.com)
    • GitHub does this automatically

How does it work if I use GitHub Pages?

Follow the instructions on the homepage, and you're done! GitHub Pages automatically converts the text files into a website for you, and then hosts it for free (!!)


How does it work if I want to edit my website on my computer?

1. Download Stuff

First, you'll need Jekyll, because that is what processes the text files into a website. Mac OS/Linux users click here. Video walkthrough for Windows here. Guide below is for Windows:

  1. Download Ruby+Devkit - With Devkit, click whichever is in bold
  2. Run the ridk install step on the last stage of the installation wizard
  3. Run "Command Prompt" by searching for it from the Start Menu, then type gem install jekyll bundler
  4. Check if Jekyll has been installed properly by typing jekyll -v

2. Run some commands

Next, you'll need to build the website from your text files. You'll need to do this every time you want to edit or see your website from your computer.

  1. Open the moonrise folder in File Explorer, type "cmd" in the URL bar and press Enter
  2. Type these commands one line at a time:
    bundle update
    bundle exec jekyll serve

3. Edit the #####.md text files

http://localhost:4000/moonrise/ is a "fake domain name" using your local computer network to allow your computer to display the website, as if it was live on the Internet. Without this, you won't be able to see Moonrise.

After you make a change, just reload http://localhost:4000/moonrise/. Jekyll will automatically build your website while it's running.

To exit out of Jekyll, press "Ctrl+C" in the Command Prompt window and it'll stop.


How do I upload my site back to GitHub?

If you have Git installed, you probably know how to work out a seamless solution.

If you don't, just upload the changed files back to GitHub! GitHub will take care of everything.

Optionally, you can download GitHub Desktop to keep your whole repo downloaded and synced. When prompted, choose the option to make your own copy of Moonrise.


What about exporting my website to a different domain/website hosting?

1. Update _config.yml

If you have a custom domain name, change the _config.yml so that:

  • url: "https://yourdomain.com"
  • baseurl: "" (empty quotes)

2. Build your website

  1. Open the moonrise folder in File Explorer, type "cmd" in the URL bar and press Enter

  2. Type these commands one line at a time:
    bundle update
    bundle exec jekyll build

2. Upload the HTML files somewhere

The HTML files are in the _site folder