Total Pageviews

Thursday, 23 April 2026

hexo-admin

 

Quickstart

1. Setup hexo & create a blog

npm install -g hexo
cd ~/
hexo init hexo-site
cd hexo-site
npm install

2. Install the admin & start things up

npm install --save hexo-admin
hexo server 
open http://localhost:4000/admin/
3.Password protection

If you're using Hexo admin on your live server, you want some password protection. To enable this, you just add a few config variables to your hexo _config.yml:

admin:
  username: myfavoritename
  password_hash: be121740bf988b2225a313fa1f107ca1
  secret: a secret something

The password_hash is the bcrypt hash of your password. The secret is used to make the cookies secure, so it's a good idea to have it be long and complicated.

A utility in Hexo admin's Settings can hash your password and generate the admin section for you. Start Hexo and go to Settings > Setup authentification and fill out your information. Copy the generated YAML into your _config.yml.

Once that's in place, start up your hexo server and going to /admin/ will require you to enter your username and password.

from  https://github.com/jaredly/hexo-admin

(不错,我在本地的windows机器上,测试成功。) 

------------

相关帖子:

 https://briteming.blogspot.com/2013/06/linux-vps-hexo.html

 

No comments:

Post a Comment