Sebenarnya saya ini, orang yg paling malas update sistem, apalagi kalau sudah jalan aman di mesin production. Tapi weblog yang saya gunakan sudah terlalu usang yaitu hexo 4.2.1 sedangkan saat ini tanggal 21 Februari 2021 sudah versi hexo 5.4.0.

Oke lah kalau begitu, hari ini saya putuskan untuk update versi hexo yang saya gunakan pada weblog ini, langsung saja mari kita mulai.

1. Buka Git Bash pada folder Hexo

2. Cek versi Hexo

1
2
3
$ hexo --version
hexo: 4.2.1
hexo-cli: 3.1.0

3. Ganti versi Hexo dari 4.2.1 ke 5.4.0 di file package.json, di dalam konfigurasi “dependencies”.

1
2
3
## Sebelum
"dependencies": {
"hexo": "^4.2.1",
1
2
3
## Sesudah
"dependencies": {
"hexo": "^5.4.0",

Save

4. Jalankan perintah npm update pada Git Bash

1
2
3
$ npm update
+ hexo@5.4.0
added 6 packages from 21 contributors, removed 48 packages, updated 36 packages and audited 233 packages in 25.461s

5. Versi Hexo akan otomatis terupdate, sekarang cek kembali versi Hexo.

1
2
3
4
5
$ hexo --version
INFO Validating config
WARN Deprecated config detected: "use_date_for_updated" is deprecated, please use "updated_option" instead. See https://hexo.io/docs/configuration for more details.
hexo: 5.4.0
hexo-cli: 3.1.0

Ternyata ada WARN Deprecated config detected: “use_date_for_updated” is deprecated, please use “updated_option” instead.

6. Sekarang buka file _config.yml didalam folder Hexo dan ubah konfigurasi dibawah ini.

1
2
3
## Sebelum
## Use post's date for updated date unless set in front-matter
use_date_for_updated: false
1
2
3
## Sesudah
## Use post's date for updated date unless set in front-matter
updated_option: 'date'

Save

7. Testing, sekarang coba jalankan hexo server, lalu commit dan push ke Github.

1
2
3
4
$ hexo server
INFO Validating config
INFO Start processing
INFO Hexo is running at http://localhost:4000 . Press Ctrl+C to stop.

8. Setelah push ke Github, berikut sreenshoot weblog saya yang sudah terupdate ke hexo 5.4.0.

Update Hexo Latest Version - whyd.net
Selesai, itu saja langkah-langkah yang perlu dilakukan untuk update versi Hexo terbaru, mudah dan sederhana bukan?