2018-10-25 04:37:04 +00:00
[curben.netlify.com ](https://curben.netlify.com/ )
===
2018-09-18 11:32:30 +00:00
2019-04-12 03:53:45 +00:00
[![Netlify Status ](https://api.netlify.com/api/v1/badges/aaf73659-db84-4c41-a700-de3926022674/deploy-status )](https://app.netlify.com/sites/curben/deploys)
2019-05-13 06:25:02 +00:00
[![Build Status ](https://gitlab.com/curben/curben.gitlab.io/badges/master/pipeline.svg )](https://gitlab.com/curben/blog/-/jobs)
2019-06-22 05:22:40 +00:00
[![Hexo version ](https://img.shields.io/badge/hexo-3.9.0-brightgreen.svg )](https://www.npmjs.com/package/hexo)
2016-04-05 15:03:17 +00:00
2018-09-20 10:18:13 +00:00
Forked from GitLab's [Hexo ](https://gitlab.com/pages/hexo ) example with [Typing ](https://github.com/geekplux/hexo-theme-typing ) theme.
2018-09-19 06:13:34 +00:00
2018-09-21 04:39:51 +00:00
## Installation
2019-05-18 05:19:46 +00:00
> Refer to [this post](https://curben.netlify.com/2018/09/21/how-to-create-a-hexo-blog/) for more detailed instruction.
2018-09-21 04:39:51 +00:00
1. Change `<folder>` to a preferred name.
2018-09-20 10:18:13 +00:00
```bash
2019-05-13 06:43:50 +00:00
git clone https://gitlab.com/curben/blog < folder >
2018-09-20 10:18:13 +00:00
```
2018-09-21 04:39:51 +00:00
2. Install Node.js.
2018-09-20 10:18:13 +00:00
```bash
2019-05-18 05:19:46 +00:00
# Ubuntu 16.04 or newer
$ sudo snap install node --classic --channel=10
# Debian
$ curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
$ sudo apt-get install -y nodejs
# Fedora 29
$ sudo dnf install npm
# Fedora 28 or older
$ curl --silent --location https://rpm.nodesource.com/setup_10.x | sudo bash -
$ sudo yum -y install nodejs
2018-09-20 10:18:13 +00:00
# Arch Linux
2019-05-18 05:19:46 +00:00
$ sudo pacman -S npm
2018-09-20 10:18:13 +00:00
```
2019-05-13 06:43:50 +00:00
3. Install Hexo and its dependencies (defined in [package.json ](package.json )). `hexo-cli` installation step can be skipped if you use [this shortcut ](https://curben.netlify.com/2018/10/24/running-locally-installed-node-packages/#Method-1 ).
2018-09-20 10:18:13 +00:00
```bash
2018-09-21 04:39:51 +00:00
$ sudo npm install -g hexo-cli
$ cd < folder >
2019-05-13 06:43:50 +00:00
$ npm install --only=prod
2018-09-20 10:18:13 +00:00
```
2018-09-21 04:39:51 +00:00
4. Generate static files to check for any error. You should _always_ do this before pushing/merging commits to the `master` branch.
2018-09-20 10:18:13 +00:00
```bash
2018-09-21 04:39:51 +00:00
$ hexo generate
```
## Quick Start
### Create a new post
``` bash
$ hexo new "My New Post"
```
More info: [Writing ](https://hexo.io/docs/writing.html )
### Run server
``` bash
$ hexo server
```
More info: [Server ](https://hexo.io/docs/server.html )
### Generate static files
``` bash
$ hexo generate
2018-09-20 10:18:13 +00:00
```
2018-09-21 04:39:51 +00:00
More info: [Generating ](https://hexo.io/docs/generating.html )
### Deploy to remote sites
``` bash
$ hexo deploy
```
More info: [Deployment ](https://hexo.io/docs/deployment.html )
2018-09-18 11:32:30 +00:00
2018-09-20 10:18:13 +00:00
## Changes
2018-10-25 04:37:04 +00:00
The following are the major changes I made compared to the upstream.
2018-09-21 04:39:51 +00:00
2018-10-25 04:37:04 +00:00
### [Hexo](https://gitlab.com/pages/hexo) site
- Update [.gitlab-ci.yml ](.gitlab-ci.yml ) to use the latest version of [Node.js ](https://hub.docker.com/_/node/ ) in Alpine docker image.
2018-09-20 10:18:13 +00:00
- Update [package.json ](package.json ) to use latest version of [hexo ](https://www.npmjs.com/package/hexo ) and its related packages.
2018-09-18 11:32:30 +00:00
- Replace the bundled Landscape theme with Typing theme.
2018-10-25 04:37:04 +00:00
- [Pre-compressed ](https://docs.gitlab.com/ee/user/project/pages/introduction.html#serving-compressed-assets ) the assets using [hexo-yam ](https://github.com/weyusi/hexo-yam ).
2018-09-18 11:32:30 +00:00
2018-10-25 04:37:04 +00:00
### [Typing](https://github.com/geekplux/hexo-theme-typing) theme
2018-09-18 11:32:30 +00:00
- Homepage shows index of posts.
2019-06-08 05:32:47 +00:00
- Use the latest version of [clipboard.js ](https://github.com/zenorocha/clipboard.js/ ) and [Fork Awesome ](https://github.com/ForkAwesome/Fork-Awesome/releases ) (disabled by default).
- Remove jQuery, fancyBox, web analytics, comment plugins and donation links.
2019-05-13 06:43:50 +00:00
- Use more [relative length ](https://www.w3schools.com/CSSref/css_units.asp ), instead of absolute length in the css.
2016-04-05 15:03:17 +00:00
2018-10-25 04:20:01 +00:00
## License
2019-06-12 08:30:35 +00:00
The content of this blog is licensed under the [CC-BY-SA license ](https://creativecommons.org/licenses/by-sa/4.0/ ), and the underlying source code used to format and display that content is licensed under the [MIT license ](LICENSE.md ), unless indicated otherwise.
2018-10-25 04:20:01 +00:00
2018-09-20 10:18:13 +00:00
---
Useful links:
2018-10-25 04:24:27 +00:00
- [Hexo Docs ](https://hexo.io/docs/ )
- [GitLab Pages ](https://docs.gitlab.com/ee/user/project/pages/index.html )
2018-09-20 04:11:03 +00:00