Browse Source

fix up post tags so that they work...

main
John-Mark Gurney 3 years ago
parent
commit
819fb3814f
4 changed files with 39 additions and 3 deletions
  1. +3
    -0
      .gitignore
  2. +3
    -1
      layout/blog.j2
  3. +28
    -0
      layout/tagged_posts.j2
  4. +5
    -2
      site.yaml

+ 3
- 0
.gitignore View File

@@ -3,3 +3,6 @@ deploy

# virtualenv
p

# automatically generated (not a fan that they're here)
content/search

+ 3
- 1
layout/blog.j2 View File

@@ -14,7 +14,7 @@
<ul class="tags clear">
{% for tag in resource.meta.tags %}
<li>
<a class="small" href="{{ content_url('blog/tags/'~tag~'.html') }}">
<a class="small" href="{{ content_url('search/label/'~tag~'.html') }}">
{{ tag }}
</a>
</li>
@@ -22,9 +22,11 @@
</ul>
{% endif %}
<div class="clear"/>
<section>
{% filter markdown|typogrify -%}
{% block post -%}{%- endblock %}
{%- endfilter %}
</section>
</article>
{%- endmark %}



+ 28
- 0
layout/tagged_posts.j2 View File

@@ -0,0 +1,28 @@
{% extends "base.j2" %}

{% block main %}
<section class="archives">
<h1 class="tag title">{{ tag.name }}</h1>
<ul class="posts clear">
{% for resource in walker() -%}
<li class="post clear">
<time datetime="{{ resource.meta.created.strftime('%Y-%m-%d') }}">
{{ resource.meta.created.strftime('%a, %d %b %Y') }}
</time>
<a href="{{ content_url(resource.url) }}">{{ resource.meta.title }}</a>
{% if resource.meta.tags %}
<ul class="tags">
{% for tag in resource.meta.tags %}
<li>
<a class="small" href="{{ content_url('search/label/'~tag~'.html') }}">
{{ tag }}
</a>
</li>
{% endfor %}
</ul>
{% endif %}
</li>
{%- endfor %}
</ul>
</section>
{% endblock %}

+ 5
- 2
site.yaml View File

@@ -38,5 +38,8 @@ tagger:
sorter: time
archives:
blog:
source: blog
target: blog/tags
source: .
target: search/label
template: tagged_posts.j2
meta:
listable: false

Loading…
Cancel
Save