trying to make header work

This commit is contained in:
Robin Müller 2023-12-08 13:43:16 +01:00
parent 45a6b0967c
commit 851c53b5e2
Signed by: muellerr
GPG Key ID: A649FB78196E3849
6 changed files with 50 additions and 14 deletions

View File

@ -1 +1,7 @@
<h1>Test</h1>
{{ define "main" }}
<div class="container">
<h2 class="display-4 text-center">Main body goes here</h2>
</div>
{{ end }}

View File

@ -0,0 +1,24 @@
<footer class="footer fixed-bottom bg-dark">
<div class="container">
<footer class="d-flex flex-wrap justify-content-between align-items-center py-3 my-4 border-top">
<p class="col-md-4 mb-0 text-body-secondary">&copy; {{ now.Year }} University of Stuttgart</p>
<a href="/" class="col-md-4 d-flex align-items-center justify-content-center mb-3 mb-md-0 me-md-auto link-body-emphasis text-decoration-none">
<svg class="bi me-2" width="40" height="32"><use xlink:href="#bootstrap"/></svg>
</a>
<ul class="nav col-md-4 justify-content-end">
<li class="nav-item"><a href="#" class="nav-link px-2 text-body-secondary">Protection of Privacy</a></li>
<li class="nav-item"><a href="#" class="nav-link px-2 text-body-secondary">Imprint</a></li>
</ul>
</footer>
</div>
<!-- JavaScript and dependencies -->
{{ $bootstrap := resources.Get "js/bootstrap.bundle.min.js" }} {{ $js := slice
$bootstrap | resources.Concat "js/bundle.js" | resources.Minify }}
<script src="{{$js.RelPermalink}}" defer></script>
</footer>

View File

@ -1 +1 @@
<p>Copyright {{ now.Year }}. All rights reserved.</p>
<p>&copy; My Dummy Website</p>

View File

@ -1,2 +1 @@
<h1>{{ site.Title }}</h1>
{{ partial "menu.html" (dict "menuID" "main" "page" .) }}

View File

@ -11,10 +11,22 @@ Renders a menu for the given menu ID.
{{- $menuID := .menuID }}
{{- with index site.Menus $menuID }}
<nav>
<ul>
{{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }}
</ul>
<nav class="navbar navbar-expand-md navbar-dark bg-dark mb-4">
<div class="container-fluid">
<a class="navbar-brand" href="#">Here be logo</a>
<button
class="navbar-toggler" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarCollapse" aria-controls="navbarCollapse"
aria-expanded="false" aria-label="Toggle navigation"
>
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarCollapse">
<ul class="navbar-nav- me-auto mb-2 mb-md-0">
{{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }}
</ul>
</div>
</div>
</nav>
{{- end }}
@ -27,8 +39,8 @@ Renders a menu for the given menu ID.
{{- else if $page.HasMenuCurrent .Menu .}}
{{- $attrs = merge $attrs (dict "class" "ancestor" "aria-current" "true") }}
{{- end }}
<li>
<a
<li class="nav-item">
<a class="nav-link" aria-current="page"
{{- range $k, $v := $attrs }}
{{- with $v }}
{{- printf " %s=%q" $k $v | safeHTMLAttr }}

View File

@ -6,8 +6,3 @@ description = 'Theme description'
# If the theme has a single author
[author]
name = 'Robin Mueller'
[module]
[[module.mounts]]
source = "node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"
target = "assets/js/bootstrap.bundle.min.js"