Added Hexo and NexT environment variables.#240
Merged
ivan-nginx merged 2 commits intomasterfrom Apr 17, 2018
Merged
Conversation
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).
houndci-bot
reviewed
Apr 17, 2018
| }); | ||
|
|
||
| hexo.extend.helper.register('next_env', function(type) { | ||
| var env = require('../package.json'); |
| return this.env[type]; | ||
| }); | ||
|
|
||
| hexo.extend.helper.register('next_env', function(type) { |
| @@ -1,5 +1,14 @@ | |||
| 'use strict'; | |||
|
|
|||
| hexo.extend.helper.register('hexo_env', function(type) { | |||
tongluyang
pushed a commit
to tongluyang/hexo-theme-next
that referenced
this pull request
Nov 19, 2019
* Added Hexo and NexT environment variables. 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). * Added `require` and `hexo` to excludes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
envvariable. Here is values: https://github.com/hexojs/hexo/blob/373b9c745cb5dfe25e942e720aca2cdac78e1874/lib/hexo/index.js#L47-L55package.jsonfile. So, no need to set version in NexT_config.ymlfile anymore. Also, all other values frompackage.jsoncan be readed withnext_env('value')function in template.package.jsonandbower.json(correct author values, some tags).