Skip to content
This repository was archived by the owner on May 11, 2025. It is now read-only.

Commit ced15ef

Browse files
Add ".active" to navigation for current page
1 parent f2a3759 commit ced15ef

13 files changed

Lines changed: 45 additions & 17 deletions

File tree

_includes/header.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
<title>
88
{%- if page.title -%}
9-
{{ page.title | smartify }} · {{ site.title | smartify }}
9+
{{ page.title | smartify }} - {{ site.title | smartify }}
1010
{%- else -%}
11-
{{ site.title | smartify }} · {{ site.description | smartify }}
11+
{{ site.title | smartify }} - {{ site.description | smartify }}
1212
{%- endif -%}
1313
</title>
1414

_includes/navbar.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,31 @@
77
<div class="navbar-nav-scroll mr-auto">
88
<ul class="navbar-nav">
99
<li class="nav-item">
10-
<a class="nav-link" href="{{ site.baseurl }}/base-images"
10+
<a class="nav-link{% if page.title == 'Base Images' %} active{% endif %}" href="{{ site.baseurl }}/base-images"
1111
onclick="ga('send', 'event', 'Navbar', 'Community links', 'Base images');">Base images</a>
1212
</li>
13-
<li class="nav-item">
13+
<li class="nav-item{% if page.title == 'Project specific images' %} active{% endif %}">
1414
<a class="nav-link" href="{{ site.baseurl }}/project-specific-images"
1515
onclick="ga('send', 'event', 'Navbar', 'Community links', 'Project specific images');">Project specific
1616
images</a>
1717
</li>
18-
<li class="nav-item dropdown">
18+
<li class="nav-item dropdown{% if page.layout == 'environment' %} active{% endif %}">
1919
<a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
2020
aria-expanded="false">Compose environments <span class="caret"></span></a>
2121
<div class="dropdown-menu">
22-
<a class="dropdown-item" href="{{ site.baseurl }}/compose-environments">Overview</a>
22+
<a class="dropdown-item{% if page.title == 'Compose environments' %} active{% endif %}" href="{{ site.baseurl }}/compose-environments">Overview</a>
2323
<div class="dropdown-divider"></div>
2424
<h6 class="dropdown-header">Products</h6>
25-
<a class="dropdown-item" href="{{ site.baseurl }}/compose-pimcore">Pimcore</a>
26-
<a class="dropdown-item" href="{{ site.baseurl }}/compose-magento2">Magento</a>
25+
<a class="dropdown-item{% if page.title == 'Compose Pimcore' %} active{% endif %}" href="{{ site.baseurl }}/compose-pimcore">Pimcore</a>
26+
<a class="dropdown-item{% if page.title == 'Compose Magento 2' %} active{% endif %}" href="{{ site.baseurl }}/compose-magento2">Magento</a>
2727
<div class="dropdown-divider"></div>
2828
<h6 class="dropdown-header">Frameworks</h6>
29-
<a class="dropdown-item" href="{{ site.baseurl }}/compose-symfony">Symfony</a>
30-
<a class="dropdown-item" href="{{ site.baseurl }}/compose-laravel">Laravel</a>
29+
<a class="dropdown-item{% if page.title == 'Compose Symfony' %} active{% endif %}" href="{{ site.baseurl }}/compose-symfony">Symfony</a>
30+
<a class="dropdown-item{% if page.title == 'Compose Laravel' %} active{% endif %}" href="{{ site.baseurl }}/compose-laravel">Laravel</a>
3131
</div>
3232
</li>
3333
<li class="nav-item">
34-
<a class="nav-link" href="{{ site.baseurl }}/about">About us</a>
34+
<a class="nav-link{% if page.title == 'About us' %} active{% endif %}" href="{{ site.baseurl }}/about">About us</a>
3535
</li>
3636
</ul>
3737
</div>

_layouts/environment.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
{% include header.html %}
5+
</head>
6+
<body>
7+
{% include navbar.html %}
8+
9+
<main id="content" class="container" role="main">
10+
<div class="row-fluid">
11+
{{ content }}
12+
</div>
13+
</main>
14+
15+
{% include footer.html %}
16+
{% include scripts.html %}
17+
</body>
18+
</html>

about/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
layout: default
3+
title: About us
34
---
45

56
<div class="mainContent container">

base-images/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
layout: default
3+
title: Base Images
34
---
45

56
<h2>Base Images</h2>

compose-environments/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
2-
layout: default
2+
layout: environment
3+
title: Compose environments
34
---
45

56
<h2>Compose environments</h2>

compose-laravel/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
2-
layout: default
2+
layout: environment
3+
title: Compose Laravel
34
---
45

56
<h2>Compose Laravel</h2>

compose-magento/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
2-
layout: default
2+
layout: environment
3+
title: Compose Magento 2
34
---
45

56
<h2>Compose Magento 2</h2>

compose-magento2/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
2-
layout: default
2+
layout: environment
3+
title: Compose Magento 2
34
---
45

56
<h2>Compose Magento 2</h2>

compose-pimcore/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
2-
layout: default
2+
layout: environment
3+
title: Compose Pimcore
34
---
45

56
<h2>Compose Pimcore</h2>

0 commit comments

Comments
 (0)