How to Make a Blog With Hexo

Written by Kai McCormick

What is Hexo

Hexo.io is a blogging framework made by Tommy Chen in 2012 using Node.js. It has support for plug-ins and themes which allow you to make your blog in any style possible. You start by setting it up in a simple few lines in the CLI and write your post in markdown.

In fact this blog was made entirely in Hexo.io. My personal use case for it is that other blog sites might charge either the blog maker or the blog reader. While this might not be the case for some others, Hexo fit my demands the best.

Why do I need to use Hexo

You do not need to use Hexo for your blog, you can use Wordpress, Medium, or Tumblr for your blog. But Hexo gives you total control of the blog and is very easy to customize and setup. Also Hexo is 100% free and relies entirely on donations and volunteers. You can also run it on any machine you want, along with it being directly supported by Github Pages and many options for use on your own domain.

How do I install Hexo

Installing Hexo is as easy as a few lines in your command line. If this is your first time using the command line (don’t be scared as it is very easy to understand how to use it. The first step in installing Hexo is to install npm (node package manager). You will need to install node.js for this but both are very easy to install. You can check if you have these installed by doing npm -v and node -v. If neither of these commands output anything then follow the instructions at the npm website. With both of those installed, you just need to run this command, in your terminal.

npm install hexo-cli -g

After running this command, wait until it is finished installing and then run these commands to setup a new folder for you hexo blogs.

hexo init blog

cd blog

npm install

hexo server

Those commands may seem confusing but I will explain. The hexo init blog creates a folder titled blog and puts all of the files needed for a hexo blog inside of it. cd blog is just changing your terminal directory to be within that blog folder. npm install installs all of the needed dependencies for your blog from what is listed in the blog folder. hexo server runs hexo locally on your machine with the default hexo theme and settings.

Setting up Hexo

For this step you will need a text editor, the ones that come built in with your computer will be sufficient. If you look inside of your blog folder, you will see these files:

  • _config.yml
  • package.json
  • scaffolds
  • source
  • themes

The config_yml file is the one we will be using. Open it up in your text editor and change it to your liking. You can read more about what each one of these options do and what the default is on the hexo website.

Once finished, with the editing of the settings for your blog, it is time to create your first blog post.

Making your first blog post

To make a new blog post you need to type some more termianl commands. The first one is to create the blog post file. This is done by running the command hexo new followed by the type of layout and the title. There are three different types of layouts. The layout called draft is for when publishing the blog post, it does not include it until you run a command on it. The layout called post creates a new blog post that will be included when publishing it. The final layout is the page layout that will create a new page for your blog. I reccomend sticking with the draft layout as it is the safest to use. Once you have decided on a layout, run the hexo new command but with the layout after it and a title in quotes. Like the following, hexo new draft "my-great-blog-post". This will make a file in the source folder, open up your .md file with your text editor and start typing up your blog post, since it supports markdown, it can have style. Once you have finished writing your blog post it is time to wrap it up.

Publishing your blog

Once you have saved your blog post, it needs to be viewed. Hexo makes this very easy to do. If you have selected a draft run the following the command,

hexo publish draft filename

Run the command but replace the filename with the name of your blog post file, usually ending in the .md. To view your blog post locally just the ame server command as before,

hexo server

This will start a local server usually with the link,

http://localhost:4000/

Since this is a local link, only you can see it. To make your files ready for posting, just do

hexo generate

This will make all of your files ready for posting. From here there should be a folder titled public, inside of it all of the files you need to put it on your website.

Conclusion

Once you have Hexo setup, making another post is easy as running those same commands. You can trust that this will work because I ran all of the same steps to make this post. Hexo has a great community and offers a lot of different ways to tweak it. This post was only an introduction to the Hexo framework and I hope that you can succeed in your blogs.

Written by Kai McCormick, Published on January 3rd, 2020

How to Escape Tutorial Hell

Introduction

A lot of programmers have been here before, no matter how much experience they have. Tutorial Purgatory or Tutorial Hell as I will be calling it in this blog, sucks precious project time and even learning time out of your career. While I may not have the answer about this topic, I have gathered many other posts about this topic to try and help explain the problem and figure out some answers.

What is Tutorial Hell

According to TheJamPearlBlog, “Basically, it is a situation where you find yourself always in the search for a new tutorial, a new book, a new course, a new lesson plan to build or create something”, what does this mean exactly? Finding new tutorials or other learning resources causes a false sense of understanding in the learner because they will assume that they understand as much as the tutorial they just watched. Usually, this is not the case as many people only retain a small amount of information from the content they get, and sometimes they assume that the more time they spend learning, the more time they are getting back to being better. Another thing of note is that according to RandellDawson from FreeCodeCamp, “The problem with tutorials is they lock you into a specific design pattern and you are unable to think for yourself.” Also, many people in the community will ask questions similar to this one, “What are some resources or tutorials to learn x.” This one here is a double edged sword because not only does it mean you know some better resources that at least one person either knows about or tried, but it also means that you are expected to get either a load of resources or a course that over explains your current task. According to MrBenJ on Medium, “This is a great question for anyone that doesn’t know where to start. Just like going for a run, cleaning the dishes, or hitting the gym, sometimes the hardest part is getting started.” His statement is very true and explains exactly why starting is the key to escaping.

How do I know I am stuck in Tutorial Hell

There are many people who believe that they are just fine and are not stuck in tutorial hell. This assumption can be false and until they check for themselves will continue being stuck under a false idea of their current progress. Following a tutorial can seem like no harm is being done, but unless you are actively a part of the process, making your own projects and modifying the code to your advantage to get a better understanding of what the course is trying to tell you, it is tutorial hell. This statement is very brazen, that is because it is. Even if this is the only video or post on the subject, copying code is the same as tracing to artists. It makes you only as good as your ability to type. Another way to tell if you are in tutorial hell is if you paid more than $50 for your course, not only does this show that you rely on tutorials to teach you stuff, but also you got ripped off.

How to escape Tutorial Hell

There are many posts that talk about how to escape tutorial hell. Writing how to escape tutorial hell in this post is not going to be worth the effect for either of us. I will give a quick summary and important quotes from the many sources I am using. According to davidmm1707 on dev.to, “Use tutorials as a baseline where you will build from, not as a crutch for everything you do.” This is handy advice because tutorials are actually similar to crutches, they help you out when you cannot. Since you can help yourself out, especially when the idea or project you want to build is your master plan, using the tutorials as a “baseline” for your project is going to be very handy. Many times you do not learn a language if you have no current use for it, same way for tutorials. Have a project and build it, which is greatly exemplified by MrBenJ on Medium.com, “It’s silly to think that this would be the approach: STEP 1: BUILD A REALLY LARGE PAGE…Break down the task. Identify the first step. Identify what action needs to be done. Then execute.” Also u/letsgohawks on Reddit puts it very nicely on the addition steps one can take to get themselves out of tutorial hell, “When you’re building your project, you will have times when you say”How the heck do I do this bit???”. Then you study and research and learn how. That’s how you learn new concepts. Also, just keep reading various blogs and articles about programming and whatever languages interest you, you’ll get introduced to new stuff all the time. Some of it will be useful to you; some of it won’t.” Replacing tutorials with semi-regular reading content can also fill that hole of learning something new just to get that feeling again. While I will not list any blogs or articles because it is content that you may enjoy reading and finding them out and learning how to setup your own way of dealing with a feed or stream of information is a step that is fun to learn how to do.

Why is Tutorial Hell such a problem

Many people think of themselves as greater than they actually are at tasks like programming, also called the dunning-kruger effect. Because of this whenever they let go of a tutorial, they feel hopeless and stupid. They view the time it would take them to complete a simple project as comparable to forever. They also end up doubting themselves of their own ability. Also according to Ray Gardener from Quora, “Because a lot of beginners are hoping to make money, but valuable software is far more difficult to develop than it used to be. So with each failure to get a job or develop something useful, novices try more learning.”. Learning is something that everyone feels like they cannot fail at. They can feel the success from actually making something, even if they themselves never made it. Also, from experience, starting projects that seem like great ideas, are only good until I get burned out or work on it for too long. Because of this inability to work on projects for a long time means that I must resort to thinking I am doing some worthwhile so I become a better programmer. I resort to tutorials for this.

Closing Thoughts

Please remember that everyone has gone through some sort of tutorial hell. It is a very common problem in a competitive market. Being able to understand tutorial hell in its entirety is something that every developer should know because it causes them to understand the problems that face them a lot better. Just remember to enjoy yourself while programming and keep practicing your skills.


Sources:
Dev.to/DavidMM1707
Medium.com/@MrBenJ
Reddit.com/r/learnprogramming
Codeburst.io
Freecodecamp.org/RandellDawson
TheJamPearlBlog
Quora.com/Why-is-tutorial-hell-a-common-problem