Skip to content

Commit d2c0fad

Browse files
committed
style: add new badge to menu
1 parent 1195de6 commit d2c0fad

File tree

5 files changed

+30
-7
lines changed

5 files changed

+30
-7
lines changed

config.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ relativeURLs = false
3434
identifier = "covidcast"
3535
name = "COVIDcast"
3636
pre = "solid/map"
37-
url = "/covidcast"
37+
url = "/covidcast/"
3838
weight = 2
3939
[[menu.main]]
4040
parent = "covidcast"
4141
name = "COVIDcast Overview"
42-
url = "/covidcast"
42+
url = "/covidcast/"
4343
weight = 1
4444
[[menu.main]]
4545
parent = "covidcast"
@@ -121,4 +121,5 @@ relativeURLs = false
121121
feedbackLikelihoodDesktop = 1
122122
feedbackDelayMin = 45 # in sec
123123
feedbackDelayMax = 180 # in sec
124-
feedbackDuration = 60 # show it for 60sec
124+
feedbackDuration = 60 # show it for 60sec
125+
highlightLinks = "/covidcast/,/covidcast/summary,/signals-dashboard/,/forecast-eval/"

themes/delphi/assets/css/layout/_header_footer.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,18 @@ $mobile-margin: 15px;
2828
margin-bottom: 0;
2929
align-items: flex-end;
3030
}
31+
32+
.uk-badge {
33+
border-radius: 3px;
34+
margin-left: 10px;
35+
background: #2D9CDB;
36+
text-transform: uppercase;
37+
padding: 4px 8px;
38+
}
39+
40+
.uk-navbar-dropdown {
41+
width: 220px;
42+
}
3143
}
3244

3345
.nav-entries .uk-active {

themes/delphi/layouts/partials/footer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<div>
88
<h5 class="uk-text-bold">COVIDcast</h5>
99
<ul class="uk-list">
10-
<li><a class="uk-link-text uk-text-small" href="{{ relref . "/covidcast" }}">Map</a></li>
10+
<li><a class="uk-link-text uk-text-small" href="{{ relref . "/covidcast" }}">Overview</a></li>
1111
<li><a class="uk-link-text uk-text-small" href="{{ relref . "/covidcast/surveys" }}">Surveys</a></li>
1212
<li>
1313
<a class="uk-link-text uk-text-small" href="{{ relref . "/covidcast/survey-results" }}">Survey Results</a>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{{ if .Pre }}
22
{{ partial "font-awesome.html" .Pre }}
33
{{ end }}
4-
{{ .Name }}
4+
{{ .Name }}

themes/delphi/layouts/partials/nav.html

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@
2727
<div class="uk-navbar-dropdown">
2828
<ul class="uk-nav uk-navbar-dropdown-nav">
2929
{{ range .Children }}
30-
<li><a href="{{ .URL | relLangURL }}">{{ partial "menu/item.html" . }}</a></li>
30+
<li><a href="{{ .URL | relLangURL }}">
31+
{{ partial "menu/item.html" . }}
32+
{{ if (in (split $currentPage.Site.Params.highlightLinks ",") .URL) }}
33+
<span class="uk-badge">New</span>
34+
{{ end }}
35+
</a></li>
3136
{{ end }}
3237
</ul>
3338
</div>
@@ -52,7 +57,12 @@
5257
{{ if .HasChildren }}
5358
{{ range .Children }}
5459
<li class="nav-dropdown-child">
55-
<a href="{{ .URL | relLangURL }}">{{ partial "menu/item.html" . }}</a>
60+
<a href="{{ .URL | relLangURL }}">
61+
{{ partial "menu/item.html" . }}
62+
{{ if (in (split $currentPage.Site.Params.highlightLinks ",") .URL) }}
63+
<span class="uk-badge">New</span>
64+
{{ end }}
65+
</a>
5666
</li>
5767
{{ end }}
5868
{{ end }}

0 commit comments

Comments
 (0)