{{ resource.meta.title }}
+{{ resource.meta.title }}
Posted: {{ resource.meta.created.strftime('%B %e, %Y') }} at {{ resource.meta.time }}
@@ -35,7 +36,7 @@ + href="{{ itemurl(resource.prev_by_time) }}"{% endif %}> Next | @@ -44,7 +45,7 @@ + href="{{ itemurl(resource.next_by_time) }}"{% endif %}> Previous diff --git a/layout/frontpage.j2 b/layout/frontpage.j2 index 22f3773..7a46778 100644 --- a/layout/frontpage.j2 +++ b/layout/frontpage.j2 @@ -1,3 +1,4 @@ +{% from "macros.j2" import itemurl %} {% extends "base.j2" %} {% block main %} @@ -21,7 +22,7 @@ + href="{{ itemurl(nextpost) }}"{% endif %}> Previous Post diff --git a/layout/macros.j2 b/layout/macros.j2 index 579fda4..e643fba 100644 --- a/layout/macros.j2 +++ b/layout/macros.j2 @@ -1,5 +1,7 @@ {% macro slug(res) %} {{ res.meta.id if res.meta.id else res.slug }}{% endmacro %} +{% macro itemurl(res) %} +{{ res.url ~ "#" ~ (res.meta.id if res.meta.id else res.slug) ~ "-title" }}{% endmacro %} {# endmacro not on new line to prevent white space at end of macro #} diff --git a/layout/tagged_posts.j2 b/layout/tagged_posts.j2 index b5b3ea2..3c42b0f 100644 --- a/layout/tagged_posts.j2 +++ b/layout/tagged_posts.j2 @@ -1,3 +1,4 @@ +{% from "macros.j2" import itemurl %} {% extends "base.j2" %} {% block main %} @@ -9,7 +10,7 @@ - {{ resource.meta.title }} + {{ resource.meta.title }} {% if resource.meta.tags %}