Explorar el Código

Render the new blog tags partial in the nav bar

master
Noah Petherbridge hace 4 años
padre
commit
c1fb1057d9
  1. 4
      www/.layout.gohtml
  2. 28
      www/blog/categories.inc.html
  3. 20
      www/blog/tags.partial.gohtml

4
www/.layout.gohtml

@ -82,8 +82,8 @@
<li>&#0187; <a href="/contact">Contact Me</a></li>
</ul>
<div class="k-section">Channels</div>
TBD
<div class="k-section">Blog Tags</div>
{{ RenderTags .Request false }}
<div class="k-section">Creativity</div>
<ul>

28
www/blog/categories.inc.html

@ -1,28 +0,0 @@
{# Custom category list for kirsle.net <ul>-based design #}
<ul>
<li>&#0187; <a href="{{ url_for('blog.archive') }}">Blog Archives</a></li>
{% for tag in tags %}
{% if not tag["small"] %}
<li>&#0187; <a href="{{ url_for('blog.category', category=tag['category']) }}">{{ tag['category'] }}</a>
<small>({{ tag['count'] }})</small></li>
{% endif %}
{% endfor %}
</ul>
{% if has_small %}
<div id="blog_show_more" style="display: none">
<ul>
{% for tag in tags %}
{% if tag["small"] %}
<li>&#0187; <a href="{{ url_for('blog.category', category=tag['category']) }}">{{ tag['category'] }}</a>
<small>({{ tag['count'] }})</small></li>
{% endif %}
{% endfor %}
</ul>
</div>
<div id="blog_show_less" style="display: block">
<ul>
<li>&#0164; <a href="#" onClick="$('#blog_show_less').hide(); $('#blog_show_more').show(1000); return false">Show more...</a></li>
</ul>
</div>
{% endif %}

20
www/blog/tags.partial.gohtml

@ -0,0 +1,20 @@
{{ if .IndexView }}
Sorted by most frequently used:
<ul>
{{ range .Tags }}
<li><a href="/tagged/{{ .Name }}">{{ .Name }}</a> ({{ .Count }})</li>
{{ end }}
</ul>
{{ else }}
<ul>
<li>&#0187; <a href="/blog/archive">Blog Archives</a></li>
{{ range .Tags }}
{{ if ge .Count 8 }}
<li>&#0187; <a href="/tagged/{{ .Name }}">{{ .Name }}</a>
<small>({{ .Count }})</small></li>
{{ end }}
{{ end }}
<li>&#0187; <a href="/tagged">View all tags</a></li>
</ul>
{{ end }}
Cargando…
Cancelar
Guardar