Log in Sign up

All posts by tag

Is there a way to loop through every tag and then print all entries with that tag below it? i.e. the /tagged/example page but with every tag and its entries, without having to specify each one individually.


3 years ago, 3 replies   Edit question

Yes, there is a way to list all the tags used and all the entries associated with each tag! Here is a brief example:


<ul>
{{#all_tags}}
  <li>
    <a href="/tagged/{{slug}}">{{tag}}</a>
    <ul>
    {{#entries}}
      <li><a href="{{{url}}}">{{title}}</a></li>
    {{/entries}}
    </ul>
  </li>
{{/all_tags}}
</ul>

Please let me know if you would like me to elaborate about the full process required to add this to your template.

Answered 4 years ago · Edit answer

I believe this is what I'm looking to do, but on a separate page. I would like a page with just my posts tagged [Links]. I would need a file in my Pages folder to be an .html, correct? When I make the page and .html file instead of .md, it does not show up anywhere on my site.

Answered 4 years ago · Edit answer

You can't include template code in a page/post inside your blog's folder. If you want to use the template engine, you need to create a new view within your template.

Either way – if you want to have a link on your menu to page which shows all the posts tagged Links I would recommending adding a link to /tagged/links to your menu. Does that solve the issue?

Answered 3 years ago · Edit answer