taglogic.html 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. <p>The following pages and posts are tagged with <button type="button" style="cursor: default" class="btn btn-default navbar-btn">{{page.tagName}}</button></p>
  2. <table><thead><tr><th>Title</th><th>Type</th><th>Excerpt</th></tr></thead>
  3. <tbody>
  4. {% assign thisTag = page.tagName %}
  5. {% for page in site.pages %}
  6. {% for tag in page.tags %}
  7. {% if tag == thisTag %}
  8. <tr><td><a href="{{ page.url | remove: "/" }}">{{page.title}}</a></td>
  9. <td><span class="label label-default">Page</span></td>
  10. <td>{% if page.summary %} {{ page.summary | strip_html | strip_newlines | truncate: 160 }} {% else %} {{ page.content | truncatewords: 50 | strip_html }} {% endif %}</td>
  11. </tr>
  12. {% endif %}
  13. {% endfor %}
  14. {% endfor %}
  15. {% assign thisTag = page.tagName %}
  16. {% for post in site.posts %}
  17. {% for tag in post.tags %}
  18. {% if tag == thisTag %}
  19. <tr><td><a href="{{ post.url | remove: "/" }}">{{post.title}}</a></td>
  20. <td><span class="label label-primary">Post</span></td>
  21. <td>{% if post.summary %} {{ post.summary | strip_html | strip_newlines | truncate: 160 }} {% else %} {{ post.content | truncatewords: 50 | strip_html }} {% endif %}</td>
  22. </tr>
  23. {% endif %}
  24. {% endfor %}
  25. {% endfor %}
  26. </tbody>
  27. </table>