File tree 3 files changed +49
-1
lines changed
3 files changed +49
-1
lines changed Original file line number Diff line number Diff line change 46
46
{% assign sorted_pages = site.pages | sort: "title" %}
47
47
{% for p in sorted_pages %}
48
48
{% if p.nav and p.autogen == nil %}
49
+ {% if p.dropdown %}
50
+ < li class ="nav-item dropdown {% if page.title == p.title %}active{% endif %} ">
51
+ < a class ="nav-link dropdown-toggle " href ="# " id ="navbarDropdown " role ="button " data-toggle ="dropdown " aria-haspopup ="true " aria-expanded ="false ">
52
+ {{ p.title }}
53
+ {% if page.title == p.title %}
54
+ < span class ="sr-only "> (current)</ span >
55
+ {% endif %}
56
+ </ a >
57
+ < div class ="dropdown-menu dropdown-menu-right " aria-labelledby ="navbarDropdown ">
58
+ {% for child in p.children %}
59
+ {% if child.title == 'divider' %}
60
+ < div class ="dropdown-divider "> </ div >
61
+ {% else %}
62
+ < a class ="dropdown-item " href ="{{ child.permalink | relative_url }} "> {{ child.title }}</ a >
63
+ {% endif %}
64
+ {% endfor %}
65
+ </ div >
66
+ </ li >
67
+ {% else %}
49
68
< li class ="nav-item {% if page.title == p.title %}active{% endif %} ">
50
69
< a class ="nav-link " href ="{{ p.url | relative_url }} ">
51
70
{{ p.title }}
55
74
</ a >
56
75
</ li >
57
76
{% endif %}
77
+ {% endif %}
58
78
{% endfor %}
59
79
{% if site.enable_darkmode %}
60
80
< div class = "toggle-container ">
Original file line number Diff line number Diff line change
1
+ ---
2
+ layout : page
3
+ title : submenus
4
+ nav : true
5
+ dropdown : true
6
+ children :
7
+ - title : publications
8
+ permalink : /publications/
9
+ - title : divider
10
+ - title : projects
11
+ permalink : /projects/
12
+ ---
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ a, table.table a {
14
14
color : var (--global-theme-color );
15
15
text-decoration : underline ;
16
16
}
17
- & :hover :after {
17
+ & :hover :after :not ( .nav-item.dropdown ) {
18
18
width : 100% ;
19
19
}
20
20
}
@@ -95,6 +95,22 @@ blockquote {
95
95
background-color : var (--global-bg-color );
96
96
opacity : 0.95 ;
97
97
}
98
+ .navbar .dropdown-menu {
99
+ background-color : var (--global-bg-color );
100
+ a :not (.active ) {
101
+ color : var (--global-text-color );
102
+ }
103
+ a :hover {
104
+ color : var (--global-hover-color );
105
+ }
106
+ }
107
+ .dropdown-item {
108
+ color : var (--global-text-color );
109
+ & :hover {
110
+ color : var (--global-hover-color );
111
+ background-color : var (--global-bg-color );
112
+ }
113
+ }
98
114
.navbar.navbar-light {
99
115
a {
100
116
& :hover {
You can’t perform that action at this time.
0 commit comments