Skip to content

Commit

Permalink
added dynamic navugation
Browse files Browse the repository at this point in the history
  • Loading branch information
agarwali committed May 19, 2016
1 parent 2f512a2 commit 6d0b7f9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
url: www.ishwaragarwal.me
# baseurl: ""
exclude: ['README.md']
permalink: pretty
12 changes: 7 additions & 5 deletions _includes/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="main-navbar">
<ul class="nav navbar-nav">
<li><a href="/about">about</a></li>
<li><a href="/featured">featured</a></li>
<li><a href="#">portfolio</a></li>
<li><a href="#">blog</a></li>
<li><a href="#">contact</a></li>
{% for item in include.nav %}
{% assign current = nil %}
{% if page.url contains item.url %}
{% assign current = 'active' %}
{% endif %}
<li class="{{ current }}"><a href="{{ item.url }}">{{ item.title }}</a></li>
{% endfor %}
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
Expand Down
2 changes: 1 addition & 1 deletion _layouts/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</head>
<body>
<header>
{% include navbar.html %}
{% include navbar.html nav=site.data.menu %}
</header>
{{content}}

Expand Down
1 change: 1 addition & 0 deletions about.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
layout: base
title: About Ishwar Agarwal
permalink: about/
---
<div class="container">
<section class="main">
Expand Down

0 comments on commit 6d0b7f9

Please sign in to comment.