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 page-specific cover settings to override site-level settings. #185

Merged
merged 1 commit into from
Jan 22, 2021
Merged

Allow page-specific cover settings to override site-level settings. #185

merged 1 commit into from
Jan 22, 2021

Conversation

corbanmailloux
Copy link
Contributor

I want to have cover photos visible by default, but I have specific pages that I want to hide them on. I'd still like to specify the cover image on this page for the structured data, but I want to hide it from the standard view.

Here's the configuration I'd like to use:

Site-level config.yml:

cover:
    hidden: false
    hiddenInSingle: false

Specific page front-matter:

cover:
  image: "image.jpg"
  hidden: true

With the previous code, the site-level settings took precedence, resulting in a visible cover photo.
With this change, the page-level setting, if specified, always wins over site-level settings.

To test this, I verified each combination of these three settings, trying unset, false, and true, and found expected results for each scenario.

@sonarcloud
Copy link

sonarcloud bot commented Jan 22, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@adityatelange adityatelange merged commit 2c67ae9 into adityatelange:master Jan 22, 2021
@corbanmailloux corbanmailloux deleted the patch-1 branch January 22, 2021 13:31
kylethedeveloper pushed a commit to kylethedeveloper/hugo-PaperMod that referenced this pull request Feb 21, 2023
check for front-matter's cover.hidden before global config's
adityatelange added a commit that referenced this pull request Nov 25, 2023
nsrahmad pushed a commit to nsrahmad/hugo-PaperMod that referenced this pull request Dec 5, 2023
zer0ttl pushed a commit to zer0ttl/hugo-PaperMod that referenced this pull request Jan 24, 2024
ayedaemon pushed a commit to ayedaemon/hugo-PaperMod that referenced this pull request Mar 27, 2024
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.

None yet

2 participants