Skip to content

Commit 39745a9

Browse files
committed
Minor fixes to navbar
1 parent edc854a commit 39745a9

File tree

4 files changed

+35
-17
lines changed

4 files changed

+35
-17
lines changed

_config.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ last_updated: false # set to true if you want to display last updated in the foo
2121

2222
navbar_fixed: true
2323
footer_fixed: false
24-
social_icons_pos: bottom
2524
# TODO: add layout settings (single page vs. multi-page)
2625

2726
# -----------------------------------------------------------------------------
@@ -80,7 +79,7 @@ news_limit: 5
8079

8180
# Build settings
8281
markdown: kramdown
83-
highlighter: pygments
82+
highlighter: rouge
8483

8584
# Includes & excludes
8685
include: ['_pages']
@@ -125,12 +124,12 @@ scholar:
125124
# -----------------------------------------------------------------------------
126125

127126
enable_google_analytics: false
128-
enable_highlight: true
127+
enable_highlight: false
129128
enable_katex: true
130129
enable_mansory: false
131130
enable_progressbar: false
132131
enable_tooltips: false
133-
show_social_icons: true
132+
show_social_icons: false
134133

135134
# -----------------------------------------------------------------------------
136135
# Library versions

_includes/header.html

+23-12
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
{% if page.title != "about" %}
77
{% assign name = site.title | split: ' ' %}
88
<a class="navbar-brand title font-weight-lighter" href="{{ site.baseurl | prepend: site.url }}/"><span class="font-weight-bold">{{ name | first }}</span> {{ name | last }}</a>
9-
{% elsif site.social_icons_pos == 'top' %}
9+
{% elsif site.show_social_icons %}
1010
<!-- Social Icons -->
1111
<div class="row ml-1 ml-sm-0">
1212
{% include social.html %}
@@ -21,25 +21,36 @@
2121
</button>
2222
<div class="collapse navbar-collapse text-right" id="navbarNav">
2323
<ul class="navbar-nav ml-auto flex-nowrap">
24-
<li class="nav-item {% if page.title == 'about' %}navbar-active{% endif %}">
24+
<!-- About -->
25+
<li class="nav-item {% if page.title == 'about' %}active{% endif %}">
2526
<a class="nav-link" href="{{ '/' | prepend: site.baseurl | prepend: site.url }}">
2627
about
2728
{% if page.title == "about" %}
2829
<span class="sr-only">(current)</span>
2930
{% endif %}
3031
</a>
3132
</li>
33+
<!-- Blog -->
34+
<li class="nav-item {% if page.url contains 'blog' %}active{% endif %}">
35+
<a class="nav-link" href="{{ '/blog/' | prepend: site.baseurl | prepend: site.url }}">
36+
blog
37+
{% if page.title == "blog" %}
38+
<span class="sr-only">(current)</span>
39+
{% endif %}
40+
</a>
41+
</li>
42+
<!-- Other pages -->
3243
{% for p in site.pages %}
33-
{% if p.title and p.url != "/" %}
34-
<li class="nav-item {% if page.nav == p.nav %}navbar-active{% endif %}">
35-
<a class="nav-link" href="{{ p.url | prepend: site.baseurl | prepend: site.url }}">
36-
{{ p.title }}
37-
{% if page.nav == p.nav %}
38-
<span class="sr-only">(current)</span>
39-
{% endif %}
40-
</a>
41-
</li>
42-
{% endif %}
44+
{% if p.title and p.url != "/" %}
45+
<li class="nav-item {% if page.title == p.title %}active{% endif %}">
46+
<a class="nav-link" href="{{ p.url | prepend: site.baseurl | prepend: site.url }}">
47+
{{ p.title }}
48+
{% if page.nav == p.nav %}
49+
<span class="sr-only">(current)</span>
50+
{% endif %}
51+
</a>
52+
</li>
53+
{% endif %}
4354
{% endfor %}
4455
</ul>
4556
</div>

_layouts/about.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
{% include news.html %}
2525
{% endif %}
2626

27-
{% if page.social and site.social_icons_pos == 'bottom' %}
27+
{% if page.social %}
2828
<div class="social">
2929
{% include social.html %}
3030
<div class="contact-note">{{ site.contact_note }}</div>

_sass/_base.scss

+8
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ a, table.table a {
5353
color: $link-color;
5454
}
5555
}
56+
.navbar-nav .nav-item.active>.nav-link {
57+
background-color: inherit;
58+
color: $link-color;
59+
font-weight: bolder;
60+
&:hover {
61+
color: $link-color;
62+
}
63+
}
5664
.contact-icon {
5765
font-size: 2rem;
5866
a {

0 commit comments

Comments
 (0)