Compare commits

...

4 Commits

Author SHA1 Message Date
Guillaume Haerinck 57d661a35c
Merge 46b957095a into 175059921f 2024-04-28 03:55:59 +08:00
Andrew D. Anderson 175059921f
add ethereum social icon (#1495) 2024-04-20 18:50:49 +05:30
guillaume-haerinck 46b957095a Use SVG path for down carret as the css one has issues when solo menu 2022-11-26 11:50:26 +01:00
guillaume-haerinck 9dc03b05c7 Support navbar child items 2022-11-06 10:53:43 +01:00
3 changed files with 41 additions and 1 deletions

View File

@ -91,3 +91,27 @@ body:not(.dark) #sun {
.logo-switches {
flex-wrap: inherit;
}
.sub-menu {
position: absolute;
visibility: hidden;
list-style: none;
z-index: 10;
border-radius: var(--radius);
padding: 0 15px;
background-color: var(--code-bg);
border: 1px solid var(--tertiary);
}
.sub-menu a:hover {
text-shadow: 0px 0px 1px currentColor;
}
.menu-item:hover .sub-menu {
visibility: visible;
display: block;
}
.sub-menu:hover {
visibility: visible;
}

View File

@ -125,7 +125,7 @@
{{- $menu_item_url := (cond (strings.HasSuffix .URL "/") .URL (printf "%s/" .URL) ) | absLangURL }}
{{- $page_url:= $currentPage.Permalink | absLangURL }}
{{- $is_search := eq (site.GetPage .KeyName).Layout `search` }}
<li>
<li class="menu-item">
<a href="{{ .URL | absLangURL }}" title="{{ .Title | default .Name }} {{- cond $is_search (" (Alt + /)" | safeHTMLAttr) ("" | safeHTMLAttr ) }}"
{{- cond $is_search (" accesskey=/" | safeHTMLAttr) ("" | safeHTMLAttr ) }}>
<span {{- if eq $menu_item_url $page_url }} class="active" {{- end }}>
@ -141,7 +141,19 @@
<path d="M10 14L21 3"></path>
</svg>
{{- end }}
{{ if .HasChildren }}
<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" fill="currentColor" viewBox="0 0 14 14">
<path d="M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z"/>
</svg>
{{ end }}
</a>
{{ if .HasChildren }}
<div class="sub-menu">
{{ range .Children }}
<a href="{{ .URL }}">{{ .Name }}</a>
{{ end }}
</div>
{{ end }}
</li>
{{- end }}
</ul>

View File

@ -229,6 +229,10 @@
<path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"></path>
<polyline points="22,6 12,13 2,6"></polyline>
</svg>
{{- else if (eq $icon_name "ethereum") -}}
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
<path d="M11.944 17.97L4.58 13.62 11.943 24l7.37-10.38-7.372 4.35h.003zM12.056 0L4.69 12.223l7.365 4.354 7.365-4.35L12.056 0z"/>
</svg>
{{- else if (eq $icon_name "exercism") -}}
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2230.4 1817.9" fill="currentColor" stroke-width="2" stroke="currentColor">
<path d="M0,905.1v-48.3c119-10.6,189.5-56.6,206.8-157.4c14.8-85.8-9.8-249.3-6.7-387.8c3.5-157,107.1-289.2,222.6-305.8