Reputation: 8066
I used https://github.com/tommy351/hexo to create a blog and hope to deploy to heroku
hexo instruction
Installation
$ npm install hexo -g
Quick Start
Setup your blog
$ hexo init blog
$ cd blog
$ npm install
Start the server
$ hexo server
Create a new post
$ hexo new "Hello Hexo"
Generate static files
$ hexo generate
I created at local and upload the app to heroku and it reported:
Releasing to testApp... ....done, v3
It looks like everything is OK, just confuse how to execute command line such as
hexo ***
on heroku
I executed
heroku run "hexo server"
it always said
bash: hexo: command not found
Upvotes: 3
Views: 558
Reputation: 69
It's not the way you should deploy hexo on Heroku.
Hexo doc(1) says you should change your file ./_config.yml to contains something like that in this part:
deploy:
type: heroku
repo: [email protected]:jefficue.git
message: Deployment of Hexo to heroku.
Bug for the current version (2): You should delete public/ from the file ./gitignore. You can check using this bash command. It should return nothing:
$ cat .gitignore|grep public
$
After you should run the following command at your project's root:
hexo generate
hexo deploy
If you want to execute something on Heroku the command is
heroku run something
In your case it seems hexo is not installed on Heroku. Don't do it but you could add the package hexo to your dependencies:
{ "name":"hexo-site", "version":"2.8.3", "private":true, "dependencies":{ "hexo-renderer-ejs":"*", "hexo-renderer-stylus":"*", "hexo-renderer-marked":"*", "hexo":"*", "connect":"2.x" } }
I've added the bold line to my./package.json and it will be automatically installed during the deployment. By default the package hexo is not present. This is a bad practice to add it. You should actually:
(1) http://hexo.io/docs/deployment.html
(2) https://github.com/hexojs/hexo/issues/764
Upvotes: 1