Skip to content

Commit 1a88d48

Browse files
author
Alban Bailly
committed
set active classs to links
1 parent f4fca61 commit 1a88d48

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

themes/linode-hugo-base-theme/gulpfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ gulp.task('compile', () => {
4848
.pipe(
4949
purgecss({
5050
content: [html],
51-
whitelist: ['mobile-nav']
51+
whitelist: ['mobile-nav', ['active']]
5252
})
5353
)
5454
.pipe(gulp.dest(output));
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{ $url := .URL }}
12
{{ range .Site.Menus.main }}
2-
<a href="{{ .URL }}">{{ .Name }}</a>
3+
<a href="{{ .URL }}" class="{{ if eq $url .URL }}active{{ end }}">{{ .Name }}</a>
34
{{ end }}

themes/linode-hugo-base-theme/srcCSS/components/0_utilities/typography.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ a {
7878

7979
a:hover,
8080
a:visited,
81-
a:active {
81+
a:active,
82+
a.active {
8283
text-decoration: underline;
8384
}
8485

themes/linode-hugo-base-theme/static/assets/css/main.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

themes/linode-hugo-base-theme/static/assets/js/main.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
// Navigation Toggle
2-
3-
const mainMenu = document.getElementById('main-menu');
4-
const menuIcon = document.getElementById('menu-icon');
5-
const mobileClass = 'open';
6-
72
function toggleNav() {
3+
const mainMenu = document.getElementById('main-menu');
4+
const menuIcon = document.getElementById('menu-icon');
5+
const mobileClass = 'open';
86
if (!mainMenu.classList.contains(mobileClass)) {
97
mainMenu.classList.add(mobileClass);
108
menuIcon.classList.add(mobileClass);

0 commit comments

Comments
 (0)