Skip to content

Pass SiteConfig to reduce duplication within PageConfig#1990

Merged
ong6 merged 1 commit into
MarkBind:masterfrom
tlylt:refactor-config
Aug 5, 2022
Merged

Pass SiteConfig to reduce duplication within PageConfig#1990
ong6 merged 1 commit into
MarkBind:masterfrom
tlylt:refactor-config

Conversation

@tlylt

@tlylt tlylt commented Aug 3, 2022

Copy link
Copy Markdown
Contributor

What is the purpose of this pull request?

  • Documentation update
  • Bug fix
  • Feature addition or enhancement
  • Code maintenance
  • DevOps
  • Improve developer experience
  • Others, please explain:

Overview of changes:
Fixes #1986

Anything you'd like to highlight/discuss:
nil

Testing instructions:
nil, covered by existing CI tests.

Proposed commit message: (wrap lines at 72 characters)
Update config objects within site & page

PageConfig has a lot of duplicate properties with SiteConfig.

Let's pass a reference of SiteConfig into Page so that required
properties can be retrieved directly from SiteConfig.

This makes common properties of a site available to processes
in Page and avoids adding those properties into PageConfig.


Checklist: ☑️

  • Updated the documentation for feature additions and enhancements
  • Added tests for bug fixes or features
  • Linked all related issues
  • No unrelated changes

@ong6 ong6 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@ong6 ong6 merged commit 57703b3 into MarkBind:master Aug 5, 2022
@ang-zeyu

ang-zeyu commented Aug 6, 2022

Copy link
Copy Markdown
Contributor

Just a quick check - does this preserve live reload support for the properties in site.json?

@tlylt

tlylt commented Aug 6, 2022

Copy link
Copy Markdown
Contributor Author

Just a quick check - does this preserve live reload support for the properties in site.json?

Hi @ang-zeyu, forgot about this 😅, doing a quick test it seems like the typical changes such as updating "titlePrefix", "title", "style" in site.json are all still working.

@jonahtanjz jonahtanjz added this to the 4.0.1 milestone Aug 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PageConfig has a lot of duplicate properties with SiteConfig - pass down and use site config where appropriate (d.easy)

4 participants