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

Added Hexo and NexT environment variables. #240

Merged
merged 2 commits into from Apr 17, 2018

Conversation

@ivan-nginx
Copy link
Member

commented Apr 17, 2018

  1. Replaced Hexo version by full env variable. Here is values: https://github.com/hexojs/hexo/blob/373b9c745cb5dfe25e942e720aca2cdac78e1874/lib/hexo/index.js#L47-L55
  2. From this moment version of NexT will be readed from package.json file. So, no need to set version in NexT _config.yml file anymore. Also, all other values from package.json can be readed with next_env('value') function in template.
  3. Edited package.json and bower.json (correct author values, some tags).
1. Replaced Hexo version by full `env` variable. Here is values: https://github.com/hexojs/hexo/blob/373b9c745cb5dfe25e942e720aca2cdac78e1874/lib/hexo/index.js#L47-L55
2. From this moment version of NexT will be readed from `package.json` file. So, no need to set version in NexT `_config.yml` file anymore. Also, all other values from `package.json` can be readed with `next_env('value')` function in template.
3. Edited `package.json` and `bower.json` (correct author values, some tags).
});

hexo.extend.helper.register('next_env', function(type) {
var env = require('../package.json');

This comment has been minimized.

Copy link
@houndci-bot

houndci-bot Apr 17, 2018

'require' is not defined.

return this.env[type];
});

hexo.extend.helper.register('next_env', function(type) {

This comment has been minimized.

Copy link
@houndci-bot

houndci-bot Apr 17, 2018

'hexo' is not defined.

@@ -1,5 +1,14 @@
'use strict';

hexo.extend.helper.register('hexo_env', function(type) {

This comment has been minimized.

Copy link
@houndci-bot

houndci-bot Apr 17, 2018

'hexo' is not defined.

@ivan-nginx ivan-nginx added this to the v6.3.0 milestone Apr 17, 2018
@ivan-nginx ivan-nginx merged commit 1f9ef9c into master Apr 17, 2018
3 checks passed
3 checks passed
Hound No violations found. Woof!
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@ivan-nginx ivan-nginx deleted the feature-env branch Apr 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.