jaredly / hexo-admin

An Admin Interface for Hexo
http://jaredly.github.io/hexo-admin/
1.77k stars 299 forks source link

How to execute 'hexo generate' by using hexo-admin ? #178

Open smile-yan opened 5 years ago

smile-yan commented 5 years ago

I need execute 'hexo generate' to generate static files after I write a blog by using hexo-admin.

Could you tell me how to do this job ? I want to do this job only by click some links. Thanks !

pirtleshell commented 5 years ago

hi @smile-yan,

i'm not sure on your exact setup but if you just need a way to call hexo generate from the dashboard, you can set that as your deploy command.

in your hexo config, add

admin:
  deployCommand: hexo generate

then hitting DEPLOY on the deploy screen will run generate for you.

let us know if that works for you.

GongT commented 4 years ago

I got this when click Deploy:

Error: spawn /usr/bin/hexo generate ENOENT
admin:
  deployCommand: /usr/bin/hexo generate
dylanparker commented 4 years ago

I found I needed to place my deploy commands in a script and then reference the script from the deployCommand config.

My hexo-deploy.sh script contains:

#!/bin/bash

hexo clean && hexo generate && hexo deploy