PageSpeed Insights Score

I used PageSpeed Insights from Google and the score is weird.

Automatically Deploy Hexo With Travis CI

Automatically Deploy Hexo With Travis CI

Credit: unsplash-logoeleven x

Publishing a new post can be too much if you do it old school hexo p && hexo d on the desktop/laptop. What’s worse is you can only publish it on a computer with Hexo installed. What if you want to write it anywhere and anytime and even on an iPad? With Travis CI (or any other CI service), each time you push a change to the GitHub repo, a build will kick off on Travis and it run anything you prepared including deploying the updated pages. It took me two nights to figure out (mostly) how to archive it :sweat_smile:, so in this post I will try to write down each step and the tricks within to make everyone’s life easier.

This post is inspired by kchen’s

Optimize Hexo With Gulp

Gulp is an open-source JavaScript toolkit created by Eric Schoffstall used as a streaming build system in front-end web development. We can use Gulp to compress the hexo static resources so that accessing our website is becoming faster. There are lots to learn about Gulp but to use it here on our Hexo webte is simple.

Create Diagrams on Hexo With Mermaid

Install package

$ yarn add hexo-filter-mermaid-diagrams

Update Hexo Blog Layout for Theme Icarus

In this post I am following instruction kindly provided by xiefayang to create a two-cloumn layout for post pages for Hexo theme icarus, so that post pages are clean and tidy, and easier to focus.

Latex Automatic Equation Numbering in Hexo With MathJax Plugin

New in MathJax v2.0 is the ability to have equations be numbered automatically. This functionality is turned off by default, so that pages don’t change when you update from v1.1 to v2.0, but it is easy to configure MathJax to produce automatic equation numbers by adding:

<script type="text/x-mathjax-config">
TeX: { equationNumbers: { autoNumber: "AMS" } }

to your page just before the <script> tag that loads MathJax.js itself.

Optimize Hexo With Lazy Loading

Lazy loading is a design pattern commonly used in computer programming to defer initialization of an object until the point at which it is needed. It can contribute to efficiency in the program’s operation if properly and appropriately used.

Override Markdown Listing

Markdown parsers have a feature: turns a list of any numbers tends into an ordered lists.
For e.g.:

1. Hello_1
3. Hello_2
001. Hello_3
98. Hello_4

I get:

  1. Hello_1
  2. Hello_2
  3. Hello_3
  4. Hello_4

But what if I want a list of non-ordered numbers?

Add an Sitemap to Your Hexo Blog

Install hexo-generator-sitemap plugin

$ npm hexo-generator-sitemap --save

Add an RSS Feed to Your Hexo Blog

  1. Install hexo-generator-feed plugin
    npm install hexo-generator-feed
Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now