Skip to content

Commit 9a05590

Browse files
committed
Add tag nav option
1 parent b8c9eb9 commit 9a05590

6 files changed

Lines changed: 51 additions & 10 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Features:
1717
- Easy setup and deploying.
1818
- Enlarge images on click.
1919
- Filter on tags.
20+
- Optional tag navigation.
2021
- Frequently updated with new versions.
2122
- Many social media links supported.
2223
- Media embed for videos.

_assets/stylesheets/modules/_header.scss

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
a {
3333
font-size: 18px;
3434
color: $header-link-color;
35+
cursor: pointer;
3536
svg {
3637
width: 16px;
3738
height: 16px;
@@ -44,6 +45,22 @@
4445
}
4546
}
4647

48+
.header-tags {
49+
padding: 0;
50+
margin: 30px 0 0;
51+
list-style: none;
52+
li {
53+
display: inline-block;
54+
padding-right: 10px;
55+
a {
56+
display: inline-block;
57+
color: $header-link-color;
58+
text-decoration: none;
59+
&:hover { color: $header-link-color-hover; }
60+
}
61+
}
62+
}
63+
4764
@include breakpoint(extra-small) {
4865
.header-nav {
4966
text-align: center;
@@ -59,4 +76,12 @@
5976
}
6077
}
6178
}
79+
.header-tags {
80+
margin: 20px 0 0;
81+
text-align: center;
82+
83+
li {
84+
padding: 0 5px;
85+
}
86+
}
6287
}

_config.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,26 @@
33
blog_theme: light # Or use dark
44
name: Chalk
55
paginate: 25
6-
url: # add your site url (format: https://example.com)
6+
url: http://chalk.nielsenramon.com
77

88

99
# Optional settings
1010

11-
theme_toggle: false # Change to true if you wish to show an icon in the navigation for dynamic theme toggling
12-
about_enabled: false # Change to true if you wish to show an icon in the navigation that redirects to the about page
13-
baseurl: # Set if blog doesn't sit at the root of the domain (format: /blog)
14-
discus_identifier: # Add your Disqus identifier
15-
ga_analytics: # Add your GA Tracking Id
11+
theme_toggle: true # Change to true if you wish to show an icon in the navigation for dynamic theme toggling
12+
about_enabled: true # Change to true if you wish to show an icon in the navigation that redirects to the about page
13+
discus_identifier: chalk-1 # Add your Disqus identifier
14+
ga_analytics: UA-28631876-6 # Add your GA Tracking Id
1615
local_fonts: false # Change to true if you wish to use local fonts
1716
rss_enabled: true # Change to false if not
1817
scrollappear_enabled: true # Change to false to disable
18+
tag_nav_enabled: true # Change to true if you wish to show an additional 'tag-list' navigation below the header
1919
social:
20-
dribbble: # Add your Dribbble handle
20+
dribbble: nielsenramon # Add your Dribbble handle
2121
facebook: # Add your Facebook handle
2222
flickr: # Add your Flickr handle
23-
github: # Add your GitHub handle
23+
github: nielsenramon # Add your GitHub handle
2424
linkedin: # Add your LinkedIn handle
25-
twitter: # Add your Twitter handle
25+
twitter: nielsenramon # Add your Twitter handle
2626
email: # Add your Email address
2727
bitcoin: # Add your Bitcoin link or address
2828
ethereum: # Add your Ethereum link or address

_includes/head.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,5 @@
6262
{% endif %}
6363

6464
{% endif %}
65-
65+
6666
</head>

_includes/navigation.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,3 +178,17 @@
178178
{% endif %}
179179
</ul>
180180
</nav>
181+
182+
{% if site.tag_nav_enabled %}
183+
<ul class="header-tags">
184+
{% assign tags = site.tags | sort %}
185+
{% for tag in tags %}
186+
{% if forloop.index > 10 %}
187+
<li>...</li>
188+
<li><a href="/tags">Show all</a></li>
189+
{% break %}
190+
{% endif %}
191+
<li><a href="{{ 'tag/' | relative_url }}{{ tag[0] }}">{{ tag[0] | capitalize }}</a></li>
192+
{% endfor %}
193+
</ul>
194+
{% endif %}

_posts/2017-12-22-configuring-chalk.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ ga_analytics: # Add your GA Tracking Id
3939
local_fonts: false # Change to true if you wish to use local fonts
4040
rss_enabled: true # Change to false if not
4141
scrollappear_enabled: true # Change to false to disable
42+
tag_nav_enabled: false # Change to true if you wish to show an additional 'tag-list' navigation below the header
4243
social:
4344
dribbble: # Add your Dribbble handle
4445
facebook: # Add your Facebook handle

0 commit comments

Comments
 (0)