Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hexo publish draft.md don't look at the right filename + markdown extensions #1821

Open
noraj opened this issue Mar 9, 2016 · 6 comments
Open
Labels
bug Something isn't working

Comments

@noraj
Copy link
Contributor

noraj commented Mar 9, 2016

Hi,

I have a markdown file source/_drafts/install-ubuntu-from-usb-stick.mkd and I wanted to use the command hexo publish install-ubuntu-from-usb-stick.mkd to publish it in my source/_posts/ folder but I get the error :

hexo publish install-ubuntu-from-usb-stick.mkd                                                
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Error: Draft "install-ubuntu-from-usb-stick-mkd" does not exist.
    at /run/media/shark/Media/CrossPlatform/www/hexo_test/node_modules/hexo/lib/hexo/post.js:197:22
    at tryCatcher (/run/media/shark/Media/CrossPlatform/www/hexo_test/node_modules/hexo/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/run/media/shark/Media/CrossPlatform/www/hexo_test/node_modules/hexo/node_modules/bluebird/js/release/promise.js:503:31)
    at Promise._settlePromise (/run/media/shark/Media/CrossPlatform/www/hexo_test/node_modules/hexo/node_modules/bluebird/js/release/promise.js:560:18)
    at Promise._settlePromise0 (/run/media/shark/Media/CrossPlatform/www/hexo_test/node_modules/hexo/node_modules/bluebird/js/release/promise.js:605:10)
    at Promise._settlePromises (/run/media/shark/Media/CrossPlatform/www/hexo_test/node_modules/hexo/node_modules/bluebird/js/release/promise.js:684:18)
    at Promise._fulfill (/run/media/shark/Media/CrossPlatform/www/hexo_test/node_modules/hexo/node_modules/bluebird/js/release/promise.js:629:18)
    at Promise._resolveCallback (/run/media/shark/Media/CrossPlatform/www/hexo_test/node_modules/hexo/node_modules/bluebird/js/release/promise.js:424:57)
    at Promise._settlePromiseFromHandler (/run/media/shark/Media/CrossPlatform/www/hexo_test/node_modules/hexo/node_modules/bluebird/js/release/promise.js:515:17)
    at Promise._settlePromise (/run/media/shark/Media/CrossPlatform/www/hexo_test/node_modules/hexo/node_modules/bluebird/js/release/promise.js:560:18)
    at Promise._settlePromise0 (/run/media/shark/Media/CrossPlatform/www/hexo_test/node_modules/hexo/node_modules/bluebird/js/release/promise.js:605:10)
    at Promise._settlePromises (/run/media/shark/Media/CrossPlatform/www/hexo_test/node_modules/hexo/node_modules/bluebird/js/release/promise.js:684:18)
    at Promise._fulfill (/run/media/shark/Media/CrossPlatform/www/hexo_test/node_modules/hexo/node_modules/bluebird/js/release/promise.js:629:18)
    at Promise._resolveCallback (/run/media/shark/Media/CrossPlatform/www/hexo_test/node_modules/hexo/node_modules/bluebird/js/release/promise.js:424:57)
    at ReductionPromiseArray._resolve (/run/media/shark/Media/CrossPlatform/www/hexo_test/node_modules/hexo/node_modules/bluebird/js/release/reduce.js:51:19)
    at Promise.completed [as _fulfillmentHandler0] (/run/media/shark/Media/CrossPlatform/www/hexo_test/node_modules/hexo/node_modules/bluebird/js/release/reduce.js:112:15)
    at Promise._settlePromise (/run/media/shark/Media/CrossPlatform/www/hexo_test/node_modules/hexo/node_modules/bluebird/js/release/promise.js:557:21)
    at Promise._settlePromise0 (/run/media/shark/Media/CrossPlatform/www/hexo_test/node_modules/hexo/node_modules/bluebird/js/release/promise.js:605:10)
    at Promise._settlePromises (/run/media/shark/Media/CrossPlatform/www/hexo_test/node_modules/hexo/node_modules/bluebird/js/release/promise.js:684:18)
    at Async._drainQueue (/run/media/shark/Media/CrossPlatform/www/hexo_test/node_modules/hexo/node_modules/bluebird/js/release/async.js:126:16)
    at Async._drainQueues (/run/media/shark/Media/CrossPlatform/www/hexo_test/node_modules/hexo/node_modules/bluebird/js/release/async.js:136:10)
    at Immediate.Async.drainQueues [as _onImmediate] (/run/media/shark/Media/CrossPlatform/www/hexo_test/node_modules/hexo/node_modules/bluebird/js/release/async.js:16:14)
    at processImmediate [as _immediateCallback] (timers.js:383:17)

the same happened when I used hexo publish source/_drafts/install-ubuntu-from-usb-stick.mkd or with a markdown file with the .md extension.

As you can see at the line Error: Draft "install-ubuntu-from-usb-stick-mkd" does not exist. the something.mkd is transformed into something-mkd so the js lib doesn't find the file.

And I wanted to add that in the official doc, there is no article saying which template langage renderer extension we can use. We know that Hexo support markdown, but by reading the doc we don't know if we can only use .md extension or if .mkd or .markdown extensions are supported too. And of course there is nothing in _confi.yml to configure wich extensions are recognize or not. By reading the doc we now that markdown and html are rendered but we don't wich other lange are or not.

Say me if I can help to write docs or contributing in another way.

Best regards and thans for this great hexo static website generator :)

PS : sorry for my poor english

@huguangju
Copy link

@shark-oxi use hexo publish 'install-ubuntu-from-usb-stick' to publish you draft, no need file ext.

@noraj
Copy link
Contributor Author

noraj commented Mar 25, 2016

Fail :

  • hexo publish source/_drafts/example
  • hexo publish source/_drafts/example.mkd
  • hexo publish example.mkd

Success :

  • hexo publish example

But what happen is I have a file.html and a file.mkd and I do hexo publish file?

@stale stale bot added the wontfix This will not be worked on label Sep 27, 2017
@noraj
Copy link
Contributor Author

noraj commented Sep 27, 2017

Stale block

@stale stale bot removed the wontfix This will not be worked on label Sep 27, 2017
@NoahDragon
Copy link
Member

I think the hexo publish only seek the .md files. Have you tried the scenario you proposed?

But what happen is I have a file.html and a file.mkd and I do hexo publish file?

@hexojs hexojs deleted a comment from stale bot Sep 27, 2017
@noraj
Copy link
Contributor Author

noraj commented Sep 27, 2017

@NoahDragon This take the .html.

@NoahDragon NoahDragon added the bug Something isn't working label Sep 27, 2017
@NoahDragon
Copy link
Member

@noraj1337 I think it is something needs to be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants
@NoahDragon @huguangju @noraj and others