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

docs(injector): helper must bind to hexo context #1485

Merged
merged 2 commits into from
Aug 10, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
docs(injector): add a missing line
curbengh committed Jul 27, 2020
commit de6ebcf559e6900f467c682392f946e3d147826f
2 changes: 1 addition & 1 deletion source/api/injector.md
Original file line number Diff line number Diff line change
@@ -62,7 +62,6 @@ hexo.extend.injector.register('body_end', () => {

Above setup will inject `APlayer.min.css` (`<link>` tag) to the `</head>` of any page which layout is `music`, and `APlayer.min.js` (`<script>` tag) to the `</body>` of those pages. Also, `jquery.js` (`<script>` tag) will be injected to `</body>` of every page generated.


## Accessing user configuration

Use any of the following options:
@@ -115,6 +114,7 @@ hexo.extend.injector.register('head_end', require('./lib/inject')(hexo))

``` js lib/inject.js
module.exports = (hexo) => () => {
const css = hexo.extend.helper.get('css');
curbengh marked this conversation as resolved.
Show resolved Hide resolved
const { cssPath } = hexo.config.fooPlugin;
return css(cssPath);
};
1 change: 1 addition & 0 deletions source/ko/api/injector.md
Original file line number Diff line number Diff line change
@@ -114,6 +114,7 @@ hexo.extend.injector.register('head_end', require('./lib/inject')(hexo))

``` js lib/inject.js
module.exports = (hexo) => () => {
const css = hexo.extend.helper.get('css');
const { cssPath } = hexo.config.fooPlugin;
return css(cssPath);
};
1 change: 1 addition & 0 deletions source/pt-br/api/injector.md
Original file line number Diff line number Diff line change
@@ -114,6 +114,7 @@ hexo.extend.injector.register('head_end', require('./lib/inject')(hexo))

``` js lib/inject.js
module.exports = (hexo) => () => {
const css = hexo.extend.helper.get('css');
const { cssPath } = hexo.config.fooPlugin;
return css(cssPath);
};
1 change: 1 addition & 0 deletions source/ru/api/injector.md
Original file line number Diff line number Diff line change
@@ -114,6 +114,7 @@ hexo.extend.injector.register('head_end', require('./lib/inject')(hexo))

``` js lib/inject.js
module.exports = (hexo) => () => {
const css = hexo.extend.helper.get('css');
const { cssPath } = hexo.config.fooPlugin;
return css(cssPath);
};
1 change: 1 addition & 0 deletions source/th/api/injector.md
Original file line number Diff line number Diff line change
@@ -114,6 +114,7 @@ hexo.extend.injector.register('head_end', require('./lib/inject')(hexo))

``` js lib/inject.js
module.exports = (hexo) => () => {
const css = hexo.extend.helper.get('css');
const { cssPath } = hexo.config.fooPlugin;
return css(cssPath);
};
1 change: 1 addition & 0 deletions source/zh-cn/api/injector.md
Original file line number Diff line number Diff line change
@@ -112,6 +112,7 @@ hexo.extend.injector.register('head_end', require('./lib/inject')(hexo))

``` js lib/inject.js
module.exports = (hexo) => () => {
const css = hexo.extend.helper.get('css');
const { cssPath } = hexo.config.fooPlugin;
return css(cssPath);
};
1 change: 1 addition & 0 deletions source/zh-tw/api/injector.md
Original file line number Diff line number Diff line change
@@ -114,6 +114,7 @@ hexo.extend.injector.register('head_end', require('./lib/inject')(hexo))

``` js lib/inject.js
module.exports = (hexo) => () => {
const css = hexo.extend.helper.get('css');
const { cssPath } = hexo.config.fooPlugin;
return css(cssPath);
};