Breadcrumb partial

This commit is contained in:
Hazem Krimi
2023-11-14 19:57:44 +01:00
parent 33b8d792cf
commit 84cd9fde72
9 changed files with 55 additions and 14 deletions
+5 -5
View File
@@ -8,11 +8,11 @@ main p {
} }
section img { section img {
float: right; float: right;
} }
@media only screen and (max-width: 1024px) { @media only screen and (max-width: 1024px) {
section img { section img {
display: none; display: none;
} }
} }
+19
View File
@@ -0,0 +1,19 @@
.breadcrumb {
margin-bottom: 0.5rem;
}
.breadcrumb ol {
padding-left: 0;
}
.breadcrumb li {
display: inline;
}
.breadcrumb li:not(:last-child)::after {
content: '';
}
.breadcrumb a {
text-transform: capitalize;
}
+7 -7
View File
@@ -23,7 +23,7 @@ header {
justify-content: space-between; justify-content: space-between;
} }
nav { nav:not(.breadcrumb) {
background-color: var(--nav-background); background-color: var(--nav-background);
display: none; display: none;
position: fixed; position: fixed;
@@ -40,7 +40,7 @@ header #header-face h3 {
font-weight: 600; font-weight: 600;
} }
header #menus a, nav #menus a { header #menus a, nav:not(.breadcrumb) #menus a {
text-decoration: none; text-decoration: none;
font-weight: 600; font-weight: 600;
font-size: 15px; font-size: 15px;
@@ -52,7 +52,7 @@ header #menus {
column-gap: 1.563rem; column-gap: 1.563rem;
} }
nav #menus { nav:not(.breadcrumb) #menus {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: end; align-items: end;
@@ -60,7 +60,7 @@ nav #menus {
row-gap: 3.125rem; row-gap: 3.125rem;
} }
nav hr { nav:not(.breadcrumb) hr {
margin-top: 3.125rem; margin-top: 3.125rem;
margin-bottom: 1.25rem; margin-bottom: 1.25rem;
} }
@@ -71,13 +71,13 @@ header #links {
column-gap: 1.5rem; column-gap: 1.5rem;
} }
nav #links { nav:not(.breadcrumb) #links {
display: flex; display: flex;
justify-content: end; justify-content: end;
column-gap: 1.5rem; column-gap: 1.5rem;
} }
nav #links .theme-toggler { nav:not(.breadcrumb) #links .theme-toggler {
margin-right: auto; margin-right: auto;
} }
@@ -90,7 +90,7 @@ header #nav-toggler {
} }
@media only screen and (max-width: 1024px) { @media only screen and (max-width: 1024px) {
header, nav { header, nav:not(.breadcrumb) {
margin: 1.5rem auto; margin: 1.5rem auto;
padding: 0.938rem 1.25rem; padding: 0.938rem 1.25rem;
} }
+1 -1
View File
@@ -1,4 +1,4 @@
--- ---
title: "Hazem Krimi" title: "Home"
date: 2023-10-18T20:03:43+01:00 date: 2023-10-18T20:03:43+01:00
--- ---
+2
View File
@@ -5,6 +5,8 @@
{{ end }} {{ end }}
{{ define "main" }} {{ define "main" }}
{{ partial "breadcrumb.html" . }}
{{ $faceImage := resources.Get "images/big-face.png" }} {{ $faceImage := resources.Get "images/big-face.png" }}
<section> <section>
+2
View File
@@ -5,6 +5,8 @@
{{ end }} {{ end }}
{{ define "main" }} {{ define "main" }}
{{ partial "breadcrumb.html" . }}
{{ .Content }} {{ .Content }}
{{ partial "contact-form.html" . }} {{ partial "contact-form.html" . }}
+2
View File
@@ -5,6 +5,8 @@
{{ end }} {{ end }}
{{ define "main" }} {{ define "main" }}
{{ partial "breadcrumb.html" . }}
{{ .Content }} {{ .Content }}
<section> <section>
+16
View File
@@ -0,0 +1,16 @@
{{ $styles := resources.Get "css/partials/breadcrumb.css" | toCSS | minify }}
<link rel="stylesheet" href="{{ $styles.Permalink }}" />
<nav aria-label="breadcrumb" class="breadcrumb">
<ol>
{{ range .Ancestors.Reverse }}
<li>
<a href="{{ .Permalink }}">{{ .Title }}</a>
</li>
{{ end }}
<li class="active">
<a aria-current="page" href="{{ .Permalink }}">{{ .Title }}</a>
</li>
</ol>
</nav>
+1 -1
View File
@@ -34,6 +34,6 @@
<script> <script>
const copyright = (document.querySelector( const copyright = (document.querySelector(
'#copyright' '#copyright'
).innerHTML = `&copy ${new Date().getFullYear()} Hazem Krimi`); ).innerHTML = `Hazem Krimi &copy ${new Date().getFullYear()}`);
</script> </script>
</footer> </footer>