Skip to content

Allow the user to override the whole configuration#1861

Merged
ivan-nginx merged 3 commits intoiissnan:masterfrom
julianxhokaxhiu:feature/issue-1860
Sep 9, 2017
Merged

Allow the user to override the whole configuration#1861
ivan-nginx merged 3 commits intoiissnan:masterfrom
julianxhokaxhiu:feature/issue-1860

Conversation

@julianxhokaxhiu
Copy link
Copy Markdown
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)
Copy link
Copy Markdown

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
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
Contributor Author

Thank you for bringing this so fast alive :)

Best regards!

@julianxhokaxhiu julianxhokaxhiu deleted the feature/issue-1860 branch September 9, 2017 08:47
@ivan-nginx ivan-nginx added this to the v5.1.3 milestone Sep 9, 2017
hk-mp5a3 pushed a commit to hk-mp5a3/hexo-theme-next that referenced this pull request Oct 11, 2025
Allow the user to override the whole configuration
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