1616 [string ]
1717 $PaletteName = $ (
1818 if ($Site -and $Site [' PaletteName' ]) { $Site [' PaletteName' ] }
19- else { ' Konsolas' }
19+ else { ' Konsolas' }
2020 ),
2121
2222 # The Google Font name
@@ -61,14 +61,14 @@ param(
6161 ),
6262
6363 # The footer menu.
64- [Collections.IDictionary ]
65- $FooterMenu = $ (
66- if ($page -and $page . ' FooterMenu ' -is [ Collections.IDictionary ] ) {
67- $page .' FooterMenu '
68- } elseif ($Site -and $site .' FooterMenu ' -is [ Collections.IDictionary ] ) {
69- $site .' FooterMenu '
64+ [PSObject [] ]
65+ $Footer = @ (
66+ if ($page.Footer ) {
67+ $page.Footer
68+ } elseif ($Site -and $site.Footer ) {
69+ $site.Footer
7070 } else {
71- [ Ordered ] @ {}
71+ ' '
7272 }
7373 )
7474)
145145 if ($HeaderMenu ) {
146146 # If the device is in landscape mode, use larger padding and gaps
147147 " @media (orientation: landscape) {"
148- " .header-menu { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 0.5em }"
148+ " .header-menu { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 0.5em; position: sticky; top: 0px }"
149149 " .header-menu-item { text-align: center; padding: 0.5em; }"
150150 " }"
151151
152152 # If the device is in portrait mode, use smaller padding and gaps
153153 " @media (orientation: portrait) {"
154- " .header-menu { display: grid; grid-template-columns: repeat(auto-fit, minmax(66px, 1fr)); gap: 0.25em }"
154+ " .header-menu { display: grid; grid-template-columns: repeat(auto-fit, minmax(66px, 1fr)); gap: 0.25em; position: sticky; top: 0px }"
155155 " .header-menu-item { text-align: center; padding: 0.25em; }"
156156 " }"
157157 }
158158)
159159
160- $ (
161- if ($FooterMenu ) {
162- " @media (orientation: landscape) {"
163- " .footer-menu { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 0.5em }"
164- " .footer-menu-item { text-align: center; padding: 0.5em; }"
165- " }"
166-
167- " @media (orientation: portrait) {"
168- " .footer-menu { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 0.25em }"
169- " .footer-menu-item { text-align: center; padding: 0.25em; }"
170- " }"
171- }
172- )
173-
174160.logo {
175161 display: inline;
176162 height: 4.2rem;
@@ -215,9 +201,8 @@ a:hover, a:focus {
215201 })
216202}
217203
218- .taskbar {
219- float: right;
220- position: absolute;
204+ .taskbar {
205+ position: sticky;
221206 top: 0; right: 0; z-index: 10;
222207 display: flex; flex-direction: row-reverse;
223208 align-content: right; align-items: flex-start;
@@ -315,18 +300,15 @@ $headerElements = @(
315300
316301# Now we declare the body elements
317302$bodyElements = @ (
318- # * The background layers
319-
320-
321-
303+ # * The background layers
322304 " <svg class='background backdrop-svg' id='background-svg' width='100%' height='100%'>"
323305 if ($page.Background -is [xml ]) {
324306 $page.Background.OuterXml
325307 }
326308 elseif ($site.Background -is [xml ]) {
327309 $site.Background.OuterXml
328310 }
329- " </svg>"
311+ " </svg>"
330312 " <canvas id='background backdrop-canvas' width='0' height='0'></canvas>"
331313 if ($taskbar ) {
332314 # * Our taskbar
@@ -346,15 +328,16 @@ $bodyElements = @(
346328 }
347329 }
348330 else { $taskbarItem.Key }
349- if ($taskbarItem.Value -match ' [<>]' ) {
331+ $taskBarContent = $taskbarItem.Value
332+ if ($taskBarContent -match ' [<>]' ) {
350333 " <details>"
351334 " <summary>"
352335 $itemIconAndOrName
353- " </summary>"
336+ " </summary>"
354337 $taskbarItem.Value
355338 " </details>"
356339 } else {
357- " <a href='$ ( $taskbarItem .Value ) ' class='icon-link' target='_blank'>"
340+ " <a href='$ ( $taskBarContent ) ' class='icon-link' target='_blank'>"
358341 $itemIconAndOrName
359342 " </a>"
360343 }
@@ -406,27 +389,26 @@ $bodyElements = @(
406389 " </header>"
407390
408391 # * The main content
392+
409393 " <div class='main'>$outputHtml </div>"
410394
411- # * The footer
412- " <footer>"
413- if ($FooterMenu ) {
414- " <style>"
415- " @media (orientation: landscape) {"
416- " .footer-menu { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 1em }"
417- " .footer-menu-item { text-align: center; padding: 1em; }"
418- " }"
419- " @media (orientation: portrait) {"
420- " .footer-menu { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 0.5em }"
421- " .footer-menu-item { text-align: center; padding: 0.5em; }"
422- " }"
423- " </style>"
424- " <nav class='footer-menu'>"
425- foreach ($menuItem in $FooterMenu.GetEnumerator ()) {
426- " <a href='$ ( $menuItem.Value ) ' class='footer-menu-item'>$ ( [Web.HttpUtility ]::HtmlEncode($menuItem.Key )) </a>"
427- }
428- " </nav>"
395+ if ($page.FixFooter -or $site.FixFooter ) {
396+ " <style>footer { position:fixed; $ (
397+ @ (
398+ foreach ($key in $site.FixFooter.Keys ) {
399+ " ${key} :$ ( $site.FixFooter [$key ]) "
400+ }
401+ foreach ($key in $page.FixFooter.Keys ) {
402+ " ${key} :$ ( $Page.FixFooter [$key ]) "
403+ }
404+ ) -join ' ;'
405+ )
406+ }</style>"
429407 }
408+
409+
410+ # * The footer
411+ " <footer>"
430412 if ($Page.Footer ) { $page.Footer -join [Environment ]::NewLine }
431413 if ($Site.Footer ) { $site.Footer -join [Environment ]::NewLine }
432414 " </footer>"
@@ -436,7 +418,9 @@ $bodyElements = @(
436418" <html>
437419 <head>
438420 <title>$ ( if ($page [' Title' ]) { $page [' Title' ] } else { $Title }) </title>
439- $ ( $headerElements -join [Environment ]::NewLine)
421+ $ ( $headerElements -join [Environment ]::NewLine)
440422 </head>
441- <body>$ ( $bodyElements -join [Environment ]::NewLine) </body>
423+ <body>
424+ $ ( $bodyElements -join [Environment ]::NewLine)
425+ </body>
442426</html>"
0 commit comments