Making My First Site

Making My First Site

Making My First Site (This One)

This was a crash course into how to code with Markdown then use a static site generator and theme to build the code and then how to get it online. I went through a couple key stages to get here.

  • Installing Jekyll

  • Updating Ruby

  • Updating RubyGems

  • Using Jekyll

  • Generating default Jekyll Site

  • Getting my post into Default Site

  • Applying a theme

  • Generate theme site

  • Customize theme

  • Boom! It’s beautiful!

  • Upload to domain


Installing Jekyll

First, what is Jekyll. Jekyll is a static site generator that will take .md posts, a theme and generate the html and css necessary to launch. Jekyll required several things to install:

  • Ruby 2.0 or higher
  • RubyGems
  • GCC & Make

(Image of Jekyll install reqs)

Imgur

I started with Ruby:

Ruby

Jekyll required Ruby 2.1 or higher. My Ruby was at 2.0 so I needed to update… So, I went to Ruby’s site to figure out how to update for mac.

I visited the install page.

Imgur

They say use Homebrew for Mac OS X so off to their site…

Imgur

Clear and easy documentation.

Install Homebrew….

![Imgur

Now back to Ruby to update…

Imgur

Boom! Ruby updated to version 2.4.2!

Imgur

RubyGems

Now to check the RubyGems…

Imgur

Initially had a minor hang up until I learned about Sudo…

Looks like I’m all good!

Imgur

What I learned

  • What package managers are and how to use them in terminal.
  • How and when to use the sudo command.
  • How and what to google to learn about any fixes or workarounds needed.

Using Jekyll

Now that Jekyll is installed, I need to figure out how to generate a site with it. I found a nice tutorial that walked be through setting up a default site and then how to apply a tutorial.

Generating Default Jekyll Site

To see how Jekyll worked I ran the command jekyll new

Imgur

The site was created, I changed to that directory and ran the command jekyll serve

Imgur

I excitedly visited the site…

Imgur

Success!

Getting My Post into Default Site

I had a default site, but now what?

I started to explore the contents of the default site…

Imgur

I removed some things and observed what they did…

Imgur

and after some guidance from a teacher and some classmates was able to place my own post in the default site.

Imgur

Awesome. Now to apply a theme and make it pretty.

What I learned

  • How web pages are generated.

Applying a Theme

Continuing with the same tutorial I began to investigate themes. A swift google of Jekyll Themes took me to http://jekyllthemes.org. Perfect.

I scrolled through the options and landed on Bef.

Imgur

It was perfect with a large front image and nice graphical organization for the posts. It also was very simple with only two additional pages.

Now how to customize it. Back to following the tutorial…

I downloaded the theme and checked out it’s contents. Very similar to the Jekyll default site but with more stuff.

Imgur

In terminal, I navigate to the Bef theme directory and run jekyll serve again…

Imgur

It ran just like the default site and when I check out the local host page there is the theme…

Imgur

Now I get it. I just need to customize the theme.

Customize Theme

Continuing to follow the tutorial, I deleted all the default content that came with the theme.

Imgur

Realized that I deleted too much and put some back.

Imgur

Next I had to modify the _config.yml file.

Imgur

It took a lot of googling to figure out what everything was and trial and error to correctly modify this key file.

Imgur

Enter jekyll serve success! Site is starting to look more like mine.

Imgur

Next I imported my images and my posts and excitedly hit refresh. But a post is missing…

Imgur

Sh$t!

Google did not help too much but when I examined the other posts I noticed they had syntax at the top that must be what Jekyll read to know where to put it.

Imgur

I added and modified the Syntax to reflect the post. Saved, and once again eagerly hit refresh…

Imgur

Yes!!

It worked. Now to deploy my site onto my domain. I should just be able to upload the ._site that Jekyll generates right?

What I learned

  • How static generator themes work.
  • How to read a theme layout and modify it.
  • How to edit and customize a config.yml file.
  • Improved ability to read and edit html.

Upload to Domain

I had been using Filezilla to transfer initial files to my domain. I dragged the ._site file to the public_html file and watched excitedly as each file uploaded rapidly.

Imgur

I brought up my browser, typed in the domain and…

Imgur

Double Sh$t!

I had no clue why the .css files and images seemed not to be working. I consulted a couple classmates about it and they pointed me in the right direction. The paths in index.html that pointed to the .css files and the image files all shared a common mistake in the path.

Imgur

After struggling with this problem for a couple hours and getting this close…

Imgur

I asked my professor. He solved it very quickly of course. It was a setting in the config file called baseurl. I had it set to StudioSite and it needed to just be set to /. I made this edit and with bated breath, once more hit jekyll serve.

Imgur

Imgur

Imgur

Imgur


Blissfully sweet success!

What I learned

  • How to use Filezilla.
  • How to navigate the back-end of my site.
  • The impact of baseurl.
Author face

Jim Murphy

Michigan born and raised. Colorado for grad school at CU-Boulder.

Recent post