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

Allow the user to override the whole configuration #1861

Merged
merged 3 commits into from
Sep 9, 2017
Merged

Allow the user to override the whole configuration #1861

merged 3 commits into from
Sep 9, 2017

Conversation

julianxhokaxhiu
Copy link
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our guidelines.
  • Tests for the changes have been added (for bug fixes / features).
  • Docs have been added / updated (for bug fixes / features).

PR Type

What kind of change does this PR introduce?

  • Bugfix.
  • Feature.
  • Code style update (formatting, local variables).
  • Refactoring (no functional changes, no api changes).
  • Build related changes.
  • CI related changes.
  • Documentation content changes.
  • Other... Please describe:

What is the current behavior?

Issue Number(s): #1860

What is the new behavior?

This PR adds a flag in the _data/next.yml configuration that allows the user to override the theme configuration. Useful if you don't want to inherit default set by the theme already.

How to use?

In NexT _config.yml:

override: true

Does this PR introduce a breaking change?

  • Yes.
  • No.

if ( data.next.override )
hexo.theme.config = data.next
else
merge(hexo.theme.config, data.next)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected '{' and instead saw 'merge'.
Missing semicolon.

data && data.next && merge(hexo.theme.config, data.next);
if ( data && data.next ) {
if ( data.next.override )
hexo.theme.config = data.next

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected '{' and instead saw 'hexo'.
Missing semicolon.

@ivan-nginx
Copy link
Collaborator

I just thinking about this a few days ago and you already do it. Great addition! I really appreciate this. And thank you very much to do NexT better!

@ivan-nginx ivan-nginx merged commit b7fbc31 into iissnan:master Sep 9, 2017
@julianxhokaxhiu
Copy link
Contributor Author

Thank you for bringing this so fast alive :)

Best regards!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants