A New Start For My Blog
I built my blog on July 27, 2017 by using GitHub Pages and Hexo. After that I post some articles on it, not too many, just 4 posts, then I dropped it. The latest post was post on July 27, 2018. This means that the blog was only active for one year, then it became inactive although it was still online. There are two reasons for this result. One is that I was too lazy to update it, the other is that I tried to write posts in English so that more people can understand, however I am not a native English speaker, my English skill is not good enough for me to write posts. Sometimes I have something to be written down, I can express it well in Chinese easily but when I try using English, I can’t even express what I want to say well.
And today, June 25, 2022, after 4 years since the last post, I decide to update my blog. I would call it a new start. I am not going to add new posts for it, instead, I am going to delete all the old contents and then rebuild it. One of the reasons is I got bored about the previous theme. I chose a simple theme when I built it, but now I think it is too simple although I like simple stuff, I prefer a more beautiful one. Another reason is that I am not satisfied with some of my post, not all, just some, but I still want to make a new start. Maybe I will move one of two posts to this new blog someday after doing some editing but not now. For the new theme, I considered using Minos by ppoffice initially but its layout didn’t render correctly, some CSS files didn’t seem to load successfully. I gave up after several failed attempts to fix it. Finally I decided to use Icarus, another work by the same author. Besides, I will use a blog.dqwyy.moe
subdomain as the domain of the blog because I think the dqwyy.moe
domain should be used for a home about me page instead.
Install and configuration
Firstly, I created a empty folder for the blog, later actions will be taken in that folder. Locate into the folder, then install Hexo with the following command. I will use cnpm here, which is a mirror site in China for npm, in order to get better Internet connection experience.
npm install -g cnpm --registry=https://registry.npmmirror.com |
Download the theme Icarus to the theme folder of Hexo and enable it at _config.yml
. Install dependent packages.
cnpm install semver |
Edit _config.yaml
and _config.icarus.yml
. These are some regular configurations, like removing unnecessary widgets, so I won’t talk about it in detail. I still have to do some tweak for the theme outside the configuration file, which means I have to touch the styles files.
Change layout width
At the default layout, the profile card widget is too wide and the main area is too narrow. Do the following changes to these two files.
function getColumnSizeClass(columnCount) { |
<div class={classname({ |
Change fonts
Edit the following files to change font family, font weight and font size. The default style doesn’t use any bold font weight, that is not my type. Besides, categories are stylized as uppercase automatically, but I am using ISO-639-1 codes as the categories to state the language of the post, and it should be in lowercase.
- $family-sans-serif ?= Ubuntu, Roboto, 'Open Sans', 'Microsoft YaHei', sans-serif |
{/* Metadata */} |
- .categories |
.navbar-item |
Change date format
The default date format is in a relative style, like x days ago. This is not my type, I want to change it to the absolute style, an exact date.
if (typeof moment === 'function') { |
Change copyright footer
The default copyright footer is “© 2022 dqwyy Powered by Hexo & Icarus”. I don’t want to use the copyright symbol here because I would like to release my posts to the Public Domain by using the CC0 license.
- <a class="footer-logo is-block mb-2" href={siteUrl}> |
Change the profile widget
I am not satisfied with the current profile widget, I would like to do the following changes.
- Make the author name bold.
- I am going to show my email address at the
author_title
field, this can be done at the configuration file of the theme. I would like use HTML entities to show the address in order to avoid spam bot, but they can’t be rendered, that is,@
is shown as@
instead of@
. I have ever considered showing it as a social platform button, using amailto:
link. However, I don’t think there are so many people using a email client, maybe more people prefer using a web version. As for me, I resist using a email client, I will just use the web version, since it’s official. - There is a “Follow” button, that is not detailed enough. Follow what? Twitter, Instagram, YouTube or other social platform? It is also duplicated with the following social platform buttons. So I am going to change the text “Follow” to “About Me”, and then make the hyperlink to my about-me page (not sure how to call it, home page or profile page?), which is still under construction.
- The social platform button is too small, I am going to increase the size.
- {author ? <p class="title is-size-4 is-block" style={{'line-height': 'inherit'}}>{author}</p> : null} |
Deploy
By now, the configuration is almost complete. I still want to tweak more, such as the color of the hyperlinks and so on, but it will take some time for me to do the research because I know nothing about ReactJSX or Stylus, which seem to be different from regular CSS. So this is for now. It’s time to deploy it to GitHub and make the blog public and accessible. Create a new repository for the blog. Two branches are required, the hexo
one for backup the configuration and post, and the gh-pages
one for the GitHub Pages, the result of the rendering.
Configure the deploy setting at _config.yaml
deploy: |
Push to the hexo
branch.
git init |
Deploy.
cnpm install hexo-deployer-git --save |
Then enable the GitHub Pages at the setting panel of the repository, and configure the DNS record of the domain.
Epilogue
I won’t guarantee to update the blog frequently, but maybe I will try my best to share something here. The language of the post will be in either English or Chinese. I will not use English all the time because my skill doesn’t allow me to do that although I hope so. The topics of the posts may be various, like technology, entertainment, science, language and life. Tags will tell you.