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

Only use lightswitch js if lightswitch is present #2594

Merged
merged 2 commits into from
May 28, 2024

Conversation

hadley
Copy link
Member

@hadley hadley commented May 28, 2024

Fixes #2585

@hadley hadley requested a review from jayhesselberth May 28, 2024 20:00
@@ -18,6 +18,10 @@
<link rel="apple-touch-icon" type="image/png" sizes="60x60" href="{{#site}}{{root}}{{/site}}apple-touch-icon-60x60.png" />
{{/has_favicons}}

{{#lightswitch}}
Copy link
Member Author

Choose a reason for hiding this comment

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

This has the added benefit of making this the first js loaded, meaning folks are less likely to get a flash of light content before the dark page loads.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Consistent with a comment @gadenbuie made early in #2338.

Copy link

github-actions bot commented May 28, 2024

Copy link
Collaborator

@jayhesselberth jayhesselberth left a comment

Choose a reason for hiding this comment

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

Confirmed this works locally for me. Good to merge.

@hadley hadley merged commit 2417d58 into main May 28, 2024
14 checks passed
@hadley hadley deleted the conditional-lightswitch-js branch May 28, 2024 21:50
SebKrantz pushed a commit to SebKrantz/pkgdown that referenced this pull request Jun 1, 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.

pkgdown generates a dark page without light-switch configuration
2 participants