Hello World
Update 2019-06-16 - Using Anaconda to install Hexo
1 | source ~/anaconda3/bin/activate |
Welcome to my very first post! This blog was created using the blog framework Hexo. As this is my first post, I will detail how I set up Hexo and deployed to GitLab pages.
Setting up a development environment and installing Hexo
Before we begin coding, it is important to first set up a proper workspace. I will be using Linux and all my Git repositories will live in a single folder. The next important step in setting up a development environment is to have clean, organized package management. I will be using virtual environments to help with this aspect.
1 | mkdir ~/venv && cd venv |
We can now install packages within this virtual environment that are separate from our system packages. If we make an mistake in our package installation, we can simply delete the virtual environment and its associated packages and make a new one. Another advantage of using virtual environments is that each Git repository can have its own environment with necessary packages for development.
Note: virtual environments must first be activated and packages must be installed using pip
.
1 | source hexo/bin/activate #activate hexo virtual environment |
Initializing the Hexo framework
Now that we have node.js and Hexo installed, we can begin setting up our blog. First we create an empty repository in GitLab with the name username.gitlab.io
. We can then git clone
in our local repository folder.
1 | cd ./username.gitlab.io |
We should now have a basic Hexo framework within our folder. Before we push to our repo, we still need to add a .gitlab-ci.yml
file. This file will contain instructions for how our repo will produce our blog. Examples of .gitlab-ci.yml
files can be found online. Finally, we can push to our repo and we should be able to see our blog at username.gitlab.io
.
Note: I won’t be covering how to make new pages or specific customizations in this post, there is plenty of documentation online.