A Hexo management tool with UI designed to make it easier for you to compose, inspired by hexo-admin.
Works with 3.x
, not sure if it works with 2.x
or 1.x
, you can give it a try :D.
- Full control over your Hexo workspace with adding, editing, deleting your posts and pages.
- Supports
post_asset_folder
setting of Hexo with uploading, deleting, referencing your corresponding assets like images and any other attachments. - Supports Hexo command
hexo generate
,hexo deploy
andhexo clean
. You only need several clicks to get your things going. - Using powerful markdown editor SimpleMDE with Auto-saving function.
- Supports password authentication for admin pages.
- Supports both Hexo default deploy settings and custom shell scripts (like executing some
cp
commands). - Supports multiple languages. Currently supports
en_US
andzh_CN
(简体中文), you can contribute to localization by editing language packs inlang
folder.
Make sure you have the permissions on the Hexo folder and files.
You'd better read through this README, especially about Auto-saving to understand the behavior of the editor.
1. Clone this repository to wherever you like and enter it. (Or download as a zip file and unzip it into your hexo folder.)
git clone https://github.com/quincyyhuang/hexo-node-admin
cd hexo-node-admin
// NPM
npm install
// Yarn
yarn
{
"port": 4001,
"admin": {
"username": "test",
"password": "test",
"plain": true
},
"hexo_dir": "/absolute/path/to/hexo", // Change this to your ABSOLUTE PATH to hexo, leave it blank if it is the current folder.
"deploy": {
"type": "default",
"script": ""
},
"lang": "en_US"
}
// Using NPM
npm start
// Using Yarn
yarn start
// Or just Node.js
node index.js
open http://localhost:4001
, your default username is test
and password is test
. You can change them later.
Because hexo-node-admin
is not actually a module or a Hexo plugin. It's more like a standalone backend that operates on Hexo resources.
By default, your password is saved in plain text. To encrypt your password, follow the steps.
The markdown editor autosaves the content in it every 3 seconds to localStorage
of your browser. If you want to apply the change to server, please click button Save
.
Notice! The editor lazy-loads your posts and pages which means only if you click button Reload
, it retrieves the file from server. Otherwise it displays what is stored in your browser(your latest editing version). In this case, you should feel safe to close the editor whenever you like without feeling unsure about your work.
Change the lang
field in config.json
. Default is en_US
. Following languages are available.
en_US
zh_CN
简体中文
Read this about post_asset_folder
before.
Change the post_asset_folder
field to true
in _config.yml
of your Hexo will do.
Notice! New asset folder of the same name with your file will be created if there isn't one.
Upload is easy. Just click the button Upload
and choose your file. It will be uploaded to the asset folder.
Delete is easy. Just click the button Assets
to show your assets and click Delete
.
You can read this on how to reference your assets in your files.
Basically:
{% asset_path slug %}
{% asset_img slug [title] %}
{% asset_link slug [title] %}
hexo-node-admin
supports 2 types of deploy, you can use both default Hexo deploy and custom shell script that can be executed on the server.
Just define your deploy setting in _config.yml
of your Hexo folder as suggested here. hexo-node-admin
will execute hexo deploy
command for you.
Change the deploy type in config.json
to custom
and specify the script
field.
Notice! Don't forget to chmod +x your_script.sh
on Linux
and Mac
.
Notice! The script
field can either be The Absolute Path of a shell file (.sh
on Linux/Mac, .cmd
or .bat
on Windows), or A single line of command like cp -fr /path/to/hexo/public/* /webroot
.
I sincerely welcome everyone to contribute to this project. Thanks a lot!
If you like this project, feel free to donate! Appreciated!
Send money to [email protected]