Skip to content

Commit

Permalink
List Pages automatically in Navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
yousinix committed Feb 12, 2019
1 parent bd5a1ab commit 183abd0
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 22 deletions.
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,19 @@ portfolYOU's sections are **independent**, you can remove any section upon your

| Projects | Articles | About |
| :--------- | :--------- | :--------- |
| pages/projects.html ¹ | pages/articles.html ¹ | pages/about.md ¹ |
| _sass/projects.scss ² | _sass/_articles.scss ² | _sass/_skills.scss ² |
| assets/js/card_animation.js ³ | _layouts/post.html | _sass/_timeline.scss ² |
| | _posts* | _layouts/about.html |
| pages/projects.html | pages/articles.html | pages/about.md |
| _sass/projects.scss ¹ | _sass/_articles.scss ¹ | _sass/_skills.scss ¹ |
| assets/js/card_animation.js ² | _layouts/post.html | _sass/_timeline.scss ¹ |
| | _posts ³ | _layouts/about.html |
| | | _includes/skills-others.html |
| | | _includes/skills-programming.html |
| | | _includes/timeline.html |

<small>
<b>If you are deleting any section, please consider the following:</b><br>
¹ remove reference from <code> _includes/navbar.html </code><br>
² remove reference from <code> assets/css/custom.scss </code><br>
³ remove reference from <code> _includes/scripts.html </code><br>
* remove permalink from <code> _config.yml </code>
¹ remove reference from <code> assets/css/custom.scss </code><br>
² remove reference from <code> _includes/scripts.html </code><br>
³ remove permalink from <code> _config.yml </code>
</small>

## Dependencies
Expand Down
8 changes: 5 additions & 3 deletions _includes/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@

<div class="collapse navbar-collapse" id="navbarNavAltMarkup">
<div class="navbar-nav ml-auto">
<a class="nav-item nav-link{% if page.url contains 'projects' %} active{% endif %}" href="{{ '/projects' | relative_url }}">Projects</a>
<a class="nav-item nav-link{% if page.url contains 'articles' %} active{% endif %}" href="{{ '/articles' | relative_url }}">Articles</a>
<a class="nav-item nav-link{% if page.url contains 'about' %} active{% endif %}" href="{{ '/about' | relative_url }}">About</a>
{% for site_page in site.pages reversed %}
{% if site_page.path contains 'pages/' %}
<a class="nav-item nav-link{% if page.url contains site_page.title %} active{% endif %}" href="{{ site_page.permalink | relative_url }}">{{ site_page.title | capitalize }}</a>
{% endif %}
{% endfor %}
</div>
</div>

Expand Down
2 changes: 0 additions & 2 deletions _layouts/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

<div class="col-lg-10 mx-auto mt-5 article">

<h1><b>{{ page.title }}</b></h1>

{{ content }}

</div>
15 changes: 7 additions & 8 deletions _posts/2018-02-06-download.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,19 @@ portfolYOU's sections are **independent**, you can remove any section upon your

| Projects | Articles | About |
| :--------- | :--------- | :--------- |
| pages/projects.html ¹ | pages/articles.html ¹ | pages/about.md ¹ |
| _sass/projects.scss ² | _sass/_articles.scss ² | _sass/_skills.scss ² |
| assets/js/card_animation.js ³ | _layouts/post.html | _sass/_timeline.scss ² |
| | _posts* | _layouts/about.html |
| pages/projects.html | pages/articles.html | pages/about.md |
| _sass/projects.scss ¹ | _sass/_articles.scss ¹ | _sass/_skills.scss ¹ |
| assets/js/card_animation.js ² | _layouts/post.html | _sass/_timeline.scss ¹ |
| | _posts ³ | _layouts/about.html |
| | | _includes/skills-others.html |
| | | _includes/skills-programming.html |
| | | _includes/timeline.html |

<small>
<b>If you are deleting any section, please consider the following:</b><br>
¹ remove reference from <code> _includes/navbar.html </code><br>
² remove reference from <code> assets/css/custom.scss </code><br>
³ remove reference from <code> _includes/scripts.html </code><br>
* remove permalink from <code> _config.yml </code>
¹ remove reference from <code> assets/css/custom.scss </code><br>
² remove reference from <code> _includes/scripts.html </code><br>
³ remove permalink from <code> _config.yml </code>
</small>

## Dependencies
Expand Down
4 changes: 3 additions & 1 deletion pages/about.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: about
title: "About Me"
title: about
permalink: /about/

# visit https://getbootstrap.com/docs/4.1/utilities/colors/#background-color
Expand Down Expand Up @@ -54,6 +54,8 @@ timeline:
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
---

# **About Me**

Hi I am **{{ site.author.name }}**,<br>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Expand Down
1 change: 1 addition & 0 deletions pages/articles.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
layout: default
title: articles
permalink: /articles/
---

Expand Down
1 change: 1 addition & 0 deletions pages/projects.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
layout: default
title: projects
permalink: /projects/

projects:
Expand Down

0 comments on commit 183abd0

Please sign in to comment.