Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Building your own website with Jekyll + Github ...

Building your own website with Jekyll + Github Pages

Leticia Portella

May 08, 2020
Tweet

More Decks by Leticia Portella

Other Decks in Technology

Transcript

  1. 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
  2. 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)
  3. 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!
  4. Templates We will use a template called Indigo But... you

    can use jekyllthemes.com to find another design that matches your style!
  5. 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
  6. 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 <username>.github.io Leave everything else as default
  7. 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
  8. 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/
  9. 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 :)
  10. 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
  11. 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
  12. Let's configure Sublime Open Sublime Then on the top you

    can click: File > Open > username > my-blog > leticia.github.io
  13. 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: <username>.github.io
  14. 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
  15. 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:
  16. 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:
  17. 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
  18. 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!
  19. 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:
  20. 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
  21. 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:
  22. Let's make the blog public Once you're finished, the link

    to the public website will be available on top:
  23. 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/
  24. Markdown 101 # Big Title ## Smaller title ### Even

    smaller title *a phrase* Phrase will be italic **a phrase** Phrase will be bold ![](https://link.com) Add image [This is a link](https://link.com) Add link * Something Bullet point
  25. 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 ;)
  26. 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?
  27. 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
  28. 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