Skip to content

Commit b74a95e

Browse files
authored
updated menu with speakers list (#159)
1 parent 95b3b72 commit b74a95e

File tree

3 files changed

+77
-27
lines changed

3 files changed

+77
-27
lines changed

hugo.toml

+23-14
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,31 @@ weight = 20
1717

1818
[[menus.main]]
1919
name = 'Code of Conduct'
20-
url = '/about/#code-of-conduct'
21-
weight = 30
20+
pageRef = '/about/#code-of-conduct'
21+
parent = 'About'
22+
weight = 21
23+
24+
[[menus.main]]
25+
name = 'Volunteer'
26+
pageRef = '/volunteer'
27+
parent = 'About'
28+
weight = 22
29+
30+
[[menus.main]]
31+
name = 'Assets'
32+
pageRef = '/assets'
33+
parent = 'About'
34+
weight = 23
2235

2336
#[[menus.main]]
24-
#name = 'Speakers'
25-
#pageRef = '/speakers'
26-
#weight = 30
37+
#name = 'Speaking'
38+
#url = 'https://pretalx.com/pyladiescon-2024/cfp'
39+
#weight = 40
40+
41+
[[menus.main]]
42+
name = 'Speakers'
43+
url = 'https://pretalx.com/pyladiescon-2024/speaker/'
44+
weight = 30
2745

2846
[[menus.main]]
2947
name = 'Schedule'
@@ -40,15 +58,6 @@ name = 'News'
4058
pageRef = '/news'
4159
weight = 50
4260

43-
[[menus.main]]
44-
name = 'Volunteer'
45-
pageRef = '/volunteer'
46-
weight = 50
47-
48-
[[menus.main]]
49-
name = 'Assets'
50-
pageRef = '/about/assets'
51-
weight = 60
5261

5362
[markup]
5463
[markup.goldmark]

themes/pyladies/assets/css/main.css

+39
Original file line numberDiff line numberDiff line change
@@ -590,3 +590,42 @@ h2 a {
590590
.social a i:hover {
591591
color: white !important;
592592
}
593+
594+
.nav-item.dropdown {
595+
position: relative;
596+
}
597+
598+
.dropdown-content {
599+
display: none;
600+
position: absolute;
601+
background-color: #f9f9f9;
602+
min-width: 200px;
603+
box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2);
604+
z-index: 1;
605+
}
606+
607+
.nav-item.dropdown:hover .dropdown-content {
608+
display: block;
609+
}
610+
611+
.dropdown-content li a {
612+
color: black;
613+
padding: 12px 16px;
614+
text-decoration: none;
615+
display: block;
616+
}
617+
618+
.dropdown-content li a:hover {
619+
background-color: #ddd;
620+
}
621+
/* Remove bullets from dropdown */
622+
.nav-item ul.dropdown-content {
623+
list-style-type: none; /* Removes bullet points */
624+
padding: 0; /* Removes padding */
625+
margin: 0; /* Removes margin */
626+
}
627+
628+
/* Optional: style dropdown list items */
629+
.dropdown-content li {
630+
padding: 8px 16px;
631+
}

themes/pyladies/layouts/partials/menu.html

+15-13
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<img class="hamburger-logo" src="/img/bar-chart-2.png"/>
1717
</button>
1818
<div class="collapse navbar-collapse" id="navbarSupportedContent">
19-
<ul class="navbar-nav mx-auto"r->
19+
<ul class="navbar-nav mx-auto">
2020
<a href="/" aria-label="PyLadiesCon">
2121
<img class="menu-logo" src="/img/icon.png"/>
2222
</a>
@@ -34,28 +34,30 @@
3434
{{- define "partials/inline/menu/walk.html" }}
3535
{{- $page := .page }}
3636
{{- range .menuEntries }}
37-
{{- $attrs := dict "href" .URL }}
37+
{{- $isActive := "href" }}
3838
{{- if $page.IsMenuCurrent .Menu . }}
39-
{{- $attrs = merge $attrs (dict "class" "active" "aria-current" "page") }}
40-
{{- else if $page.HasMenuCurrent .Menu .}}
41-
{{- $attrs = merge $attrs (dict "class" "ancestor" "aria-current" "true") }}
39+
{{- $isActive = "active" }}
40+
{{- else if $page.HasMenuCurrent .Menu . }}
41+
{{- $isActive = "ancestor" }}
4242
{{- end }}
43+
4344
{{- $name := .Name }}
4445
{{- with .Identifier }}
4546
{{- with T . }}
4647
{{- $name = . }}
4748
{{- end }}
4849
{{- end }}
49-
<li class="nav-item px-4">
50-
<a class="py-2 d-flex d-md-inline-block menu-font"
51-
{{- range $k, $v := $attrs }}
52-
{{- with $v }}
53-
{{- printf " %s=%q" $k $v | safeHTMLAttr }}
54-
{{- end }}
55-
{{- end -}}
50+
51+
<!-- Dropdown class if there are children -->
52+
<li class="nav-item px-4 {{ if .HasChildren }}dropdown{{ end }}">
53+
<a href="{{ .URL }}"
54+
class="py-2 d-flex d-md-inline-block menu-font {{ $isActive }}"
55+
{{ if eq $isActive "active" }} aria-current="page"{{ else if eq $isActive "ancestor" }} aria-current="true"{{ end }}
5656
>{{ $name }}</a>
57+
5758
{{- with .Children }}
58-
<ul>
59+
<!-- Dropdown content for submenu items -->
60+
<ul class="dropdown-content">
5961
{{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }}
6062
</ul>
6163
{{- end }}

0 commit comments

Comments
 (0)