jaredly / hexo-admin Goto Github PK
View Code? Open in Web Editor NEWAn Admin Interface for Hexo
Home Page: http://jaredly.github.io/hexo-admin/
An Admin Interface for Hexo
Home Page: http://jaredly.github.io/hexo-admin/
Is it possible somehow to protect admin page?
When I try to publish/unpublish post I got error "source is undefined" and after reloading the page a post will be updated... .It seems like it was a similar issue with creating new post and replacing slashes "var post = hexo.model('Post').findOne({source: source.replace(//g, '/')})" resolve this issue,but still you have the same issue with publish/unpublish/remove posts.
Can you figure it out,please?
When I test the module in localhost:4000/admin, it works normal.But when I deploy to github and open the url http://blog.boring.ren/admin find it doesn't work.The error is 404.
When I unpulish a post.It only wait on Loading...
The post does unpublished.I can only see the result in another browser tab page.
I can't make sure this is a issue just on me or others also meet with it.
I want to install hexo-admin v1.1.1 for Hexo 3. According to README:
$ npm install --save hexo-admin-plugin
I found it only install [email protected]. Then I searched the npm packages and found another repo called hexo-admin
that should be the one to install.
However, even though I installed it via the following command:
$ npm install --save hexo-admin
, it will still complaints that some modules sort of depd
, debug
, bytes
, http-errors
, icon-lite
... are missing as I type hexo server -d
.
So could you update the README and help me install v1.1.1? Thanks.
hexo: 3.1.1
os: Darwin 14.5.0 darwin x64
http_parser: 2.3
node: 0.12.4
v8: 3.28.71.19
uv: 1.5.0
zlib: 1.2.8
modules: 14
openssl: 1.0.1m
I host my blog as static pages on github. I use the admin dashboard mainly for the markdown editor and the ease of use. What I'd really like to see is something to generate and deploy, so I can publish posts. Maybe even have a feature to generate and deploy when an article is published, though it would make most sense to have a "Publish" button then.
I'd be interested in making a PR request. I don't think this would be too difficult to implement. Does anyone else feel like this would be an attractive feature?
is it possible to change display_name or set a default display_name from hexo-admin?
Err:
ERROR Plugin load failed: hexo-admin
ReferenceError: hexo is not defined
at Object.<anonymous> (h:\QianCheng\qiancheng.me\node_modules\hexo-admin\update.js:4:10)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (h:\QianCheng\qiancheng.me\node_modules\hexo-admin\api.js:3:17)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (h:\QianCheng\qiancheng.me\node_modules\hexo\lib\hexo\index.js:213:21)
at h:\QianCheng\qiancheng.me\node_modules\hexo-admin\index.js:7:11
at h:\QianCheng\qiancheng.me\node_modules\hexo\lib\hexo\index.js:229:12
at tryCatcher (h:\QianCheng\qiancheng.me\node_modules\hexo\node_modules\bluebird\js\main\util.js:24:31)
at Promise._settlePromiseFromHandler (h:\QianCheng\qiancheng.me\node_modules\hexo\node_modules\bluebird\js\main\promise.js:454:31)
at Promise._settlePromiseAt (h:\QianCheng\qiancheng.me\node_modules\hexo\node_modules\bluebird\js\main\promise.js:530:18)
at Promise._settlePromises (h:\QianCheng\qiancheng.me\node_modules\hexo\node_modules\bluebird\js\main\promise.js:646:14)
at Async._drainQueue (h:\QianCheng\qiancheng.me\node_modules\hexo\node_modules\bluebird\js\main\async.js:175:16)
at Async._drainQueues (h:\QianCheng\qiancheng.me\node_modules\hexo\node_modules\bluebird\js\main\async.js:185:10)
at Async.drainQueues (h:\QianCheng\qiancheng.me\node_modules\hexo\node_modules\bluebird\js\main\async.js:15:14)
at process._tickCallback (node.js:415:13)
INFO Hexo is running at http://0.0.0.0:4000/. Press Ctrl+C to stop.
Env:
hexo: 3.0.1
os: Windows_NT 6.2.9200 win32 ia32
http_parser: 1.0
node: 0.10.22
v8: 3.14.5.9
ares: 1.9.0-DEV
uv: 0.10.19
zlib: 1.2.3
modules: 11
openssl: 1.0.1e
When creating new post nothing happens (no xhr requests and new files in source)
Also there is nothing in console
What about password protection for this plugin?
At local , http://localhost:4000/admin/ can take effect. but ,at my website(xxxx.com/admin) can't take effect.Is it my wrong? Can you give me some advice?
The Publish button is only local of course since we are running the Hexo server. Maybe if you had a settings file we could specify if we want to keep functionality local only as you have it, or also call hexo deploy -g
or some other shell command for custom deployments.
In api.js
var post = hexo.model('Post').findOne({source: source})
is coming back undefined. The file is successfully created, but never added to the database. As a result , any POST requests to /post/new just hangs.
The api request is hanging because of the function addIsDraft
function addIsDraft(post) {
console.log(1);
post.isDraft = post.source.indexOf('_draft') === 0 //THIS LINE
console.log(2);
post.isDiscarded = post.source.indexOf('_discarded') === 0
return post
}
The function will never reach '2' because the marked line throws a silent error when post is undefined. I would suggest a validity check in that function!
As for why hexo.model('Post').findOne({source: source})
isn't finding anything I'm not sure. I'm not familiar enough with the underlying frameworks to be able to debug further without spending a few hours getting familiar with them!
npm WARN deprecated [email protected]: deprecated, use lowercase '[email protected]' from now on
Possibly related to #60
After creating new post and hitting enter or clicking the check mark the input field disappears and nothing else happens.
Currently there's not much - it should do useful things when api calls fail.
Why was MD5 chosen?
MD5 should never be used in a security context: https://www.google.com/search?q=md5%20security%20vulnerability
This may belong in another plugin that could integrate with hexo-admin, but I've really been wanting the ability to queue posts to be published later. So I could write up several posts in one sitting, queue them up, and maybe have them published daily. I'm digging into hexo now to figure out the best way to make this happen. Just thought I'd put it in here as an issue to see if you had any thoughts.
This would be good to implement
I see you created a new version, 1.1.0
that support the version of x3.0.0 hexo, I wonder when will publish it in the NPM.
I cannot reach /admin
Hexo runs with no errors
INFO Start processing
INFO Hexo is running at http://localhost:4000/blog/. Press Ctrl+C to stop.
My packages.config file is as follows
{
"name": "hexo-site",
"version": "0.0.0",
"private": true,
"hexo": {
"version": "3.2.0"
},
"dependencies": {
"hexo": "^3.2.0",
"hexo-admin": "^2.0.1",
"hexo-generator-archive": "^0.1.4",
"hexo-generator-category": "^0.1.3",
"hexo-generator-index": "^0.2.0",
"hexo-generator-tag": "^0.2.0",
"hexo-renderer-ejs": "^0.2.0",
"hexo-renderer-marked": "^0.2.10",
"hexo-renderer-stylus": "^0.3.1",
"hexo-server": "^0.2.0"
}
}
Possibly relevant are the facts that I'm reverse-proxying http://localhost:4000/blog/ to a sub-domain of /blog so I'm trying to reach /blog/admin and that it shows no sign of hexo-admin starting
Hello Jaredly!
I really appreciate of your amazing work on Hexo.
I am wondering if hexo-admin can work fine with Hexo 3.x
Thanks!
Recently, i wanna to deploy my Blog with this plugin to Heroku.
But, i was not found when i access to http://<domain-name>/admin
Tell me why i can't deploy it?
Currently seems everyone can access /admin, any easy way to avoid this?
[error] HexoError: Plugin load failed: hexo-admin-plugin
Error: Cannot find module 'moment'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/Users/ippotsuko/program/git/hexosync/ippotsuko/node_modules/hexo-admin-plugin/update.js:3:12)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
Great work on this plugin -- it significantly lowers the barrier to entry for Hexo users who may not be comfortable with the command line.
Anyway, I'm looking to use hexo-admin plugin in conjunction with hexo-multiauthor. That requires an authorId
field in the front-matter of each post, which it would be nice to be able to set from the admin interface.
How would you feel about adding a configuration option somewhere that would allow users to add more metadata fields alongside Date, Tags and Categories? Thanks.
(PS Go Cougs 😉)
This is a nice plugin for posting blog articles. But I've some concerns. At the beginning, I am using some markdown editor to write articles, and find it is not good because there are some extended markdown syntax or other plugins (example: mathjax, diagram) which my editor may not support.
But, when I tried hexo-admin, it also cannot support these plugin, and I can confirm that if I open the post article in browser directly, it works (it shows my math equations, my diagrams). Can the "preview" of hexo-admin preview the actual final results (same with what you see in browser directly)? Or I've missed anything? If not supported, I do not see a reason to use hexo-admin instead of other markdown editors. Any idea?
Thanks,
Shenghong
Error happened while publish a new post, or just click to edit the tag.
events.js:160
throw er; // Unhandled 'error' event
^
Error: EISDIR: illegal operation on a directory, read
at Error (native)
What is admin.deployCommand?
I'm thinking I'll move them to a _discarded
directory, and let you restore them, or clean it out.
I want to know how can i use "secret" for cookie protection
So, Would you mind if i asking you to write about "secret" more specifically?
It would be great if the meta settings dropdown could parse frontmatter similar to prose.io (maybe based on a config yml file like they do)? I use several other metadata settings in posts that are in my hexo scaffold.
New Post 功能似乎无效
OS version:win8.1 x64
node version:0.12.0
npm install hexo-cli -g
hexo init blog
cd blog
npm install
hexo server
this works fine.
but when npm install --save hexo-admin-plugin, then hexo server,I get the error :
ERROR Plugin load failed: hexo-admin
ReferenceError: hexo is not defined
why I got this error?
I install hexo-generator-feed plugin with the same error.
I use hexo generate to get my blog static files, can i use this plugin in this way
i use ubuntu14.04 and reference this blog https://www.digitalocean.com/community/tutorials/how-to-create-a-blog-with-hexo-on-ubuntu-14-04
Sometime I wanna give a meaningful name to my new post,which is not like the title of the post.Currently I use the mv cmd to change the post's name in the shell. I know it's not necessary ,but I think it could be perfect with the name-modifying function.
my hexo JSON Front-matter as follows:
;;;
"title": "我的VIM配置",
"categories": "工具",
"tags": ["linux", "vim"]
;;;
and i select this markdown file to edit, error came out:
YAMLException: end of the stream or a document separator is expected at line 1, column 19:
"title": "我的VIM配置",
^
at generateError (/Users/jeremy/dev/git/blog/node_modules/js-yaml/lib/js-yaml/loader.js:162:10)
at throwError (/Users/jeremy/dev/git/blog/node_modules/js-yaml/lib/js-yaml/loader.js:168:9)
at readDocument (/Users/jeremy/dev/git/blog/node_modules/js-yaml/lib/js-yaml/loader.js:1508:5)
at loadDocuments (/Users/jeremy/dev/git/blog/node_modules/js-yaml/lib/js-yaml/loader.js:1544:5)
at Object.load (/Users/jeremy/dev/git/blog/node_modules/js-yaml/lib/js-yaml/loader.js:1561:19)
at parseYAML (/Users/jeremy/dev/git/blog/node_modules/hexo-front-matter/lib/front_matter.js:80:21)
at Function.parse (/Users/jeremy/dev/git/blog/node_modules/hexo-front-matter/lib/front_matter.js:56:12)
at module.exports (/Users/jeremy/dev/git/blog/node_modules/hexo-admin/update.js:31:20)
at /Users/jeremy/dev/git/blog/node_modules/hexo-admin/api.js:221:5
at /Users/jeremy/dev/git/blog/node_modules/hexo-admin/api.js:91:7
Hi there,
I entered the password variable to the _config.yml but after reboot /admin returns cannot GET admin
Please advise, works with the .yml variables removed.
Thanks,
how to config admin.deployCommand?
I get this error when I try to create a new post.
Unhandled rejection TypeError: Cannot read property 'source' of undefined
at addIsDraft (E:\Project\hexoblog\node_modules\hexo-admin\api.js:11:24)
at E:\Project\hexoblog\node_modules\hexo-admin\api.js:187:18
at tryCatcher (E:\Project\hexoblog\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (E:\Project\hexoblog\node_modules\bluebird\js\release\promise.js:502:31)
at Promise._settlePromise (E:\Project\hexoblog\node_modules\bluebird\js\release\promise.js:559:18)
at Promise._settlePromise0 (E:\Project\hexoblog\node_modules\bluebird\js\release\promise.js:604:10)
at Promise._settlePromises (E:\Project\hexoblog\node_modules\bluebird\js\release\promise.js:683:18)
at Promise._fulfill (E:\Project\hexoblog\node_modules\bluebird\js\release\promise.js:628:18)
at Promise._settlePromise (E:\Project\hexoblog\node_modules\bluebird\js\release\promise.js:572:21)
at Promise._settlePromise0 (E:\Project\hexoblog\node_modules\bluebird\js\release\promise.js:604:10)
at Promise._settlePromises (E:\Project\hexoblog\node_modules\bluebird\js\release\promise.js:683:18)
at Promise._fulfill (E:\Project\hexoblog\node_modules\bluebird\js\release\promise.js:628:18)
at Promise._resolveCallback (E:\Project\hexoblog\node_modules\bluebird\js\release\promise.js:445:14)
at Promise._settlePromiseFromHandler (E:\Project\hexoblog\node_modules\bluebird\js\release\promise.js:514:17)
at Promise._settlePromise (E:\Project\hexoblog\node_modules\bluebird\js\release\promise.js:559:18)
at Promise._settlePromise0 (E:\Project\hexoblog\node_modules\bluebird\js\release\promise.js:604:10)
at Promise._settlePromises (E:\Project\hexoblog\node_modules\bluebird\js\release\promise.js:683:18)
at Promise._fulfill (E:\Project\hexoblog\node_modules\bluebird\js\release\promise.js:628:18)
at MappingPromiseArray.PromiseArray._resolve (E:\Project\hexoblog\node_modules\bluebird\js\release\promise_array.js:
125:19)
at MappingPromiseArray._promiseFulfilled (E:\Project\hexoblog\node_modules\bluebird\js\release\map.js:97:18)
at MappingPromiseArray.PromiseArray._iterate (E:\Project\hexoblog\node_modules\bluebird\js\release\promise_array.js:
113:31)
at MappingPromiseArray.init (E:\Project\hexoblog\node_modules\bluebird\js\release\promise_array.js:77:10)
hexo cli work well:
E:\Project\hexoblog>hexo new asdasdasd
INFO Created: E:\Project\hexoblog\source\_posts\asdasdasd.md
Maybe due to cross origin?
chrome console:
Failed to load resource: net::ERR_CONNECTION_REFUSED
bundle.js:845 Failed! to make post Error: Origin is not allowed by Access-Control-Allow-Origin(…)
i'm the first time to use admin
when i edit a article,and modify some text ,then i click publish,
the console show me this text:
hsiuniendeMBP:blog hsiunien$ hexo server -d INFO Start processing INFO Hexo is running at http://0.0.0.0:4000/. Press Ctrl+C to stop. Unhandled rejection TypeError: Cannot read property 'source' of undefined at addIsDraft (/Users/hsiunien/www/blog/node_modules/hexo-admin/api.js:11:24) at /Users/hsiunien/www/blog/node_modules/hexo-admin/api.js:51:16 at /Users/hsiunien/www/blog/node_modules/hexo-admin/update.js:76:9 at tryCatcher (/Users/hsiunien/www/blog/node_modules/hexo/node_modules/bluebird/js/release/util.js:16:23) at Promise._settlePromiseFromHandler (/Users/hsiunien/www/blog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:502:31) at Promise._settlePromise (/Users/hsiunien/www/blog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:559:18) at Promise._settlePromise0 (/Users/hsiunien/www/blog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:604:10) at Promise._settlePromises (/Users/hsiunien/www/blog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:683:18) at Promise._fulfill (/Users/hsiunien/www/blog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:628:18) at Promise._settlePromise (/Users/hsiunien/www/blog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:572:21) at Promise._settlePromise0 (/Users/hsiunien/www/blog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:604:10) at Promise._settlePromises (/Users/hsiunien/www/blog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:683:18) at Promise._fulfill (/Users/hsiunien/www/blog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:628:18) at MappingPromiseArray.PromiseArray._resolve (/Users/hsiunien/www/blog/node_modules/hexo/node_modules/bluebird/js/release/promise_array.js:125:19) at MappingPromiseArray._promiseFulfilled (/Users/hsiunien/www/blog/node_modules/hexo/node_modules/bluebird/js/release/map.js:97:18) at Promise._settlePromise (/Users/hsiunien/www/blog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:564:26) at Promise._settlePromise0 (/Users/hsiunien/www/blog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:604:10) at Promise._settlePromises (/Users/hsiunien/www/blog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:683:18) at Async._drainQueue (/Users/hsiunien/www/blog/node_modules/hexo/node_modules/bluebird/js/release/async.js:138:16) at Async._drainQueues (/Users/hsiunien/www/blog/node_modules/hexo/node_modules/bluebird/js/release/async.js:148:10) at Immediate.Async.drainQueues [as _onImmediate] (/Users/hsiunien/www/blog/node_modules/hexo/node_modules/bluebird/js/release/async.js:17:14) at processImmediate [as _immediateCallback] (timers.js:368:17)
We can parse categories and tags as JSON that this plugin outputs https://github.com/timnew/hexo-generator-atom-markdown-writer-meta so that instead of having to type (and remember the correct category name) we can choose to select existing ones. This is more important for categories than tags but both are useful.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.