Comments (4)
create deploy-script in project dir:
$ touch hexo-deploy.sh; chmod a+x hexo-deploy.sh
with such 2 lines for example or any custom code:
#!/usr/bin/env sh
hexo deploy
and edit _config.yml:
admin:
deployCommand: './hexo-deploy.sh'
from hexo-admin.
I've found the like with deployCommand here: https://github.com/jaredly/hexo-admin/blob/8312967c7f707418dbb6ae5116e03292862d9dc4/api.js
use('deploy', function(req, res, next) {
if (req.method !== 'POST') return next()
if (!hexo.config.admin || !hexo.config.admin.deployCommand) {
return res.done({error: 'Config value "admin.deployCommand" not found'});
}
try {
deploy(hexo.config.admin.deployCommand, req.body.message, function(err, result) {
console.log('res', err, result);
if (err) {
return res.done({error: err.message || err})
}
res.done(result);
});
} catch (e) {
console.log('EEE', e);
res.done({error: e.message})
}
});
I tried to fill the admin
section with different values of this parameter - nothing seems to work. Unfortunately.
from hexo-admin.
I have the problem with admin.deployCommand
too.
from hexo-admin.
This appears sufficiently answered thanks to @vladpurga. The deploy command is any command you'd like run on the terminal. Placing many commands in a bash script or batch file is a great way to do it.
Be aware that Windows does not use hashbangs (telling how to execute the file with the first line of a file, the #!/usr/bin/env sh
in the example above). Thus, you'll need to play with what command will execute properly, perhaps by using a batch file or prefacing your hexo command with node.exe
or some other Windows-recognized executable command.
from hexo-admin.
Related Issues (20)
- bcrypt-nodejs is no longer actively mai ntained. Please use bcrypt or bcryptjs.
- 欧弟
- about del page and post
- 登陆密码忘了怎么找回
- How to delete a draft?
- support images rlative path
- Multiple Admins/Passwords possible?
- Error: Function yaml.safeLoad is removed in js-yaml 4. Use yaml.load instead, which is now safe by default. HOT 2
- Deploy cms to heroku
- How to change HTTP to HTTPS
- Advice: move this repo to hexojs official org
- Plugin can't load properly HOT 1
- 报错:Function yaml.safeLoad is removed in js-yaml 4. Use yaml.load instead, which is now safe by default. HOT 2
- 设置登录账户密码后无法编辑博客
- admin新增修改一直loading HOT 4
- How to support keywords just like tag and categories? HOT 1
- white screen HOT 3
- white screen
- add new post can't custom fontmatter
- After entering the password, there is no response when you click SUBMIT
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hexo-admin.