Building your own website using
Jekyll + Github Pages
@leportella
Slide 2
Slide 2 text
Based on a post by @jtemporal
https://jtemporal.com/publishing-a-website-with-jekyll/
Slide 3
Slide 3 text
Why have your own website?
● You don't depend on a third-party website to host it
● You have access to analytics that you want (for free) in many other tools
● We shouldn't let the internet become the domain of a single corporation
(Medium, LinkedIn... I am looking at you)
● It is fun!
More on a blog post: https://leportella.com/my-experience-with-blogs.html
Slide 4
Slide 4 text
For this tutorial you need
● A terminal (iterm for MacOs)
● Git
● Ruby/Gem (Ruby package installer)
● A Github account
● Sublime (or any text editor)
● A Disqus account (optional)
● A google account (optional)
● An imgur account (optional)
Slide 5
Slide 5 text
Disclaimer!
I made this tutorial non-engineering friendly. If you know what I'm talking about,
feel free to take the slides and go faster :)
For non-engineers:
We will use a lot of terminal. Some
concepts might be tricky, so don't feel
afraid of errors and you are encouraged to
ask questions!
Slide 6
Slide 6 text
Templates
We will use a template called Indigo
But...
you can use jekyllthemes.com to find another design that matches your style!
Slide 7
Slide 7 text
Let's install things
Open the program iterm
Slide 8
Slide 8 text
Creating a new folder!
Create a new folder using the command
mkdir my-blog
Enter your new folder
cd my-blog
Now let's install what we need for jekyll!
gem install jekyll bundler
Slide 9
Slide 9 text
Now let's create ourselves a repository
Go to github.com
On the right side, click New to create a new repository
Give the name .github.io
Leave everything else as default
Slide 10
Slide 10 text
Let's make it available in our computer!
Copy the link gave afterwards
On the terminal, clone the repo locally using the same link
git clone https://github.com/leportella/leportella.git
Now let's see that the folder exists:
ls
Slide 11
Slide 11 text
Wait… let's understand what's going on
Slide 12
Slide 12 text
Now let's download the project
To download we will use this command:
git clone https://github.com/sergiokopplin/indigo
You can see that there is also a new folder called indigo on your computer:
ls
Now we have two folders: indigo-stable/ and leportella.github.io/
Now let's copy what's inside indigo to our own repository
cp -r indigo-stable/* leportella.github.io/
Slide 13
Slide 13 text
What was that?
We don't want to keep
the connection with the
Indigo original repository.
By copying the content,
we will do that locally :)
Slide 14
Slide 14 text
Let's make our first commit :)
Enter your blog's folder
cd leportella.github.io/
Now let's do
git add *
git commit -m "Initial commit"
git push origin master
Slide 15
Slide 15 text
What was that?
Slide 16
Slide 16 text
Let's install the requirements
Run:
bundle install
Now run:
bundle exec jekyll serve
Open your browser and go to localhost:4000
Obs: ctrl+c to exit this process
Slide 17
Slide 17 text
Let's make our website
seems ours!
Slide 18
Slide 18 text
Let's configure Sublime
Open Sublime
Then on the top you can click:
File > Open > username > my-blog
> leticia.github.io
Slide 19
Slide 19 text
Now open the file _config.yml
Open the _config.yml file
Change a couple of things: name, bio, description, email, social medias, etc
Change also the url to the name of your repo: .github.io
Slide 20
Slide 20 text
Now open the file _config.yml
Save the file. On the terminal click
Command+C to kill the website
process.
Restart the process again with
bundle exec jekyll serve
See the changes you made in
localhost:4000
Slide 21
Slide 21 text
Let's add our own photo
Go to imgur > images > add images >
upload a photo you like :)
Then click on your photo and get the
photo url
Then change on the _config.yml file to
have your direct link:
Slide 22
Slide 22 text
Can you see any change?
Slide 23
Slide 23 text
Let's add comments!
Slide 24
Slide 24 text
Let's add comments :)
Go to disqus.com
Select I want to install Disqus on my site
Slide 25
Slide 25 text
Let's add comments :)
Define an identifier to your website
Choose the Basic plan
Slide 26
Slide 26 text
Let's add comments :)
Choose Jekyll on the platforms
Slide 27
Slide 27 text
Let's add comments :)
Just click Configure on the next page and then again Complete Setup.
Get the unique identifier and add it to the _config.yaml file:
Slide 28
Slide 28 text
Now let's make it online!
We made a lot of changes on the _config.yml file. Let's make them public!
git add _config.yml
git commit -m "adding my configs"
git push origin master
If you open your Github repository page, you will see that the _config files have
changed
Slide 29
Slide 29 text
Now let's make it online!
Slide 30
Slide 30 text
What was that?
Slide 31
Slide 31 text
Let's check online!
Go to the online link: leportella.github.io
If you open a post that already exists you will see that you need to agree if a
couple of things from disqus, but after that, you have space for people to comment
on your blog post!
Slide 32
Slide 32 text
Real life example
Slide 33
Slide 33 text
Let's add analytics!
Slide 34
Slide 34 text
Let's add analytics
Go to https://analytics.google.com
Click start measuring and create your profile
You will get an ID like UA-1234567-8
Add this to the file:
Slide 35
Slide 35 text
Now let's make it online!
We made yet another change on the _config.yml file. Let's make it public!
git add _config.yml
git commit -m "adding google analytics"
git push origin master
If you open your Github repository page, you will see that the _config files have
changed again
Slide 36
Slide 36 text
What does that mean?
If you open your website in a new browser, for instance, and go again to the
analytics page you will see an access:
Slide 37
Slide 37 text
Real life example
Slide 38
Slide 38 text
Questions?
Slide 39
Slide 39 text
Let's make the blog public
On Github repository, go to the settings tab:
Slide 40
Slide 40 text
Let's make the blog public
Then search for Github Pages and on sources select master
Slide 41
Slide 41 text
Let's make the blog public
Once you're finished, the link to the public website will be available on top:
Slide 42
Slide 42 text
Celebrate!
Slide 43
Slide 43 text
Let's create a blog post
Slide 44
Slide 44 text
What is Markdown?
Markdown is a language formatting :)
You could say that it is an HTML simplified
You can use markdown as a way of making your post's styles.
If you check, one of the original blog posts have a lot of examples of things you
can do:
http://localhost:4000/markdown-common-elements/
Slide 45
Slide 45 text
Markdown 101
# Big Title
## Smaller title
### Even smaller title
*a phrase* Phrase will be italic
**a phrase** Phrase will be bold
 Add image
[This is a link](https://link.com) Add link
* Something Bullet point
Slide 46
Slide 46 text
Let's create a blog post!
Double click _posts/ folder and create a new file.
On the new file create this structure:
Pro-tip: use the other files inside
_posts/ to get the basic structure ;)
Slide 47
Slide 47 text
Let's create a blog post!
Use Command+S to save the file with the name:
2020-03-11-my-first-post.markdown
Restart the process on iterm. What happens on your local website?
Slide 48
Slide 48 text
A new post has arrived!
Slide 49
Slide 49 text
When to write?
● When you have a good idea
○ Example: https://leportella.com/new-eng-stripe.html
● When you want to structure something you've learn
○ Example: https://leportella.com/scala-I.html
● When you want to share something about a experience you had:
○ Example: https://leportella.com/from-oceanographer-to-programmer.html
● When you saw a thread online that requires further things to be said
○ Example: https://leportella.com/why-you-should-be-in-communities.html
● When you answer someone and the answer took you more than 5 minutes to
write it down
○ Example: https://leportella.com/my-experience-with-blogs.html
Slide 50
Slide 50 text
Ready for a challenge?
Slide 51
Slide 51 text
Challenges!
● Create a blog post that it is not marked as green
● Check the markdown options you have
● Publish your blog post on the online version of your blog!
● Change the About page!
● What's the difference between a project and a blog post?
● Create a new author!
● Change authors in your blog post
● Delete the original posts