Skip to content

Commit

Permalink
Updated Layout header, footer fixed / not fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
gruendau committed Aug 12, 2023
1 parent 72092ab commit b50111f
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 11 deletions.
6 changes: 3 additions & 3 deletions config/_default/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ params:
slogan: we love Swift!
headerTitle: Einführung in Swift und SwiftUI

switches:
# Layout
layout:
fixedHeader: true
fixedFooter: true

stickyHeader: false
# stickyHeader: true
switches:

# Admin
# Layout
Expand Down
3 changes: 2 additions & 1 deletion layouts/partials/footer.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- partial footer.html -->

<!-- Fixed footer -->
{{ if .Site.Params.fixedFooter }}
{{ if .Site.Params.Layout.fixedFooter }}
<div class="fixed-bottom">
{{ else }}
<div>
Expand Down Expand Up @@ -44,4 +44,5 @@
</div>
</div>
</div>

</div>
7 changes: 5 additions & 2 deletions layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
<!-- text-Color: https://getbootstrap.com/docs/5.0/utilities/colors/#colors -->

<!-- Fixed header -->
{{ if .Site.Params.fixedHeader }}
{{ if .Site.Params.Layout.fixedHeader }}
<div class="fixed-top">
{{ else }}
<div>
{{ end }}

<div class="csBorder">
<div class="container-fluid rounded bg-warning px-2 pb-2 ">
<div class="container-fluid rounded bg-warning">
<div class="px-2 pb-2">
<!-- position-sticky -->
<div class="row">
<div class="col">
Expand Down Expand Up @@ -133,4 +134,6 @@
</div>
</div>
</div>
</div>

</div>
20 changes: 15 additions & 5 deletions layouts/partials/layout/fixed-header-fixed-footer.html
Original file line number Diff line number Diff line change
@@ -1,25 +1,35 @@
<!-- partial fixed-header-fixed-footer.html -->

{{ with .Site.Params }}
<!-- Used in baseof.html -->

{{ with .Site.Params.Layout }}

<!-- fixed header, fixed footer -->
{{ if ( and .fixedHeader .fixedFooter ) }}
{{ if .fixedHeader }}
{{ if .fixedFooter }}
<main class="mt-5 pt-5 mb-5 pb-2" >
{{ end }}
{{ end }}

<!-- header, fixed footer -->
{{ if ( and ( not .fixedHeader ) .fixedFooter ) }}
{{ if not .fixedHeader }}
{{ if .fixedFooter }}
<main class="mt-0 pt-2 mb-5 pb-2">
{{ end }}
{{ end }}

<!-- fixed header, footer -->
{{ if ( and .fixedHeader ( not .fixedFooter ) ) }}
{{ if .fixedHeader }}
{{ if not .fixedFooter }}
<main class="mt-5 pt-5 mb-0 pb-2">
{{ end }}
{{ end }}

<!-- header, footer -->
{{ if ( and ( not .fixedHeader ) ( not .fixedFooter ) ) }}
{{ if not .fixedHeader }}
{{ if not .fixedFooter }}
<main class="mt-0 pt-2 mb-0 pb-2">
{{ end }}
{{ end }}

{{ end }}

0 comments on commit b50111f

Please sign in to comment.