Skip to content

Commit 3137e24

Browse files
committed
docs: autoreveal the body on docs pages
1 parent 90ad09f commit 3137e24

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

core/pfe-core/core.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,13 @@ const bodyNoAutoReveal = document.body.hasAttribute('no-auto-reveal');
9090
/** Global patternfly elements config */
9191
window.PfeConfig = Object.assign(window.PfeConfig ?? {}, {
9292
trackPerformance: window.PfeConfig?.trackPerformance ?? getMeta('pfe-track-performance') === 'true',
93-
autoReveal: window.PfeConfig?.autoReveal ?? bodyNoAutoReveal ? !bodyNoAutoReveal : getMeta('pfe-auto-reveal') === 'true',
93+
// if the body tag has `no-auto-reveal` attribute, reveal immediately
94+
// if `<meta name="pfe-auto-reveal">` exists, and it's `content` is 'true',
95+
// then auto-reveal the body
96+
autoReveal: window.PfeConfig?.autoReveal ?? (
97+
bodyNoAutoReveal ? !bodyNoAutoReveal
98+
: getMeta('pfe-auto-reveal') === 'true'
99+
),
94100
get log() {
95101
return !!localStorage.pfeLog;
96102
},

docs/_includes/_head.njk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
44
<meta name="theme-color" content="#004080">
55
<meta name="description" content="{{ title }} - PatternFly Elements">
6+
<meta name="pfe-auto-reveal" content="true">
67
<title>{{ element.title or title }} - PatternFly Elements</title>
78
<link href="/brand/logo/svg/pfe-icon-blue.svg" rel="shortcut icon">
89

0 commit comments

Comments
 (0)