Renames url filter to url

This commit is contained in:
Zach Leatherman 2018-01-16 21:20:54 -06:00
parent cb83242ac7
commit 9fe4905608
3 changed files with 4 additions and 4 deletions

View File

@ -31,7 +31,7 @@ module.exports = function(config) {
rssDate: dateObj => {
return dateToISO(dateObj);
},
absoluteUrl: url => {
url: url => {
// If your blog lives in a subdirectory, change this:
let rootDir = "/";
if( !url || url === "/" ) {

View File

@ -12,7 +12,7 @@
<a href="/""><img src="/img/logo.png" class="logo"></a>
<ul class="nav">
{%- for nav in collections.nav -%}
<li class="nav-item"><a href="{{ nav.url | absoluteUrl }}">{{ nav.data.navtitle }}</a></li>
<li class="nav-item"><a href="{{ nav.url | url }}">{{ nav.data.navtitle }}</a></li>
{%- endfor -%}
</header>
@ -20,7 +20,7 @@
<footer>
<p><em><a href="/feed/">Subscribe to my feed</a></em></p>
<p><em>Current page: <code>{{ page.url }}</code></em></p>
<p><em>Current page: <code>{{ page.url | url }}</code></em></p>
</footer>
</body>
</html>

View File

@ -2,7 +2,7 @@
<ul>
{%- for post in posts -%}
<li{% if post.url == url %} class="post-active"{% endif %}>
<a href="{{ post.url | absoluteUrl }}">{{ post.data.title }}</a>
<a href="{{ post.url | url }}">{{ post.data.title }}</a>
Tags: {{ post.data.tags | join(", ") }}
{%- if post.url == url %}
(You are here)