How to display tags in the post list? #606
Replies: 5 comments 8 replies
-
You may be running into the use of |
Beta Was this translation helpful? Give feedback.
-
I too am looking to see if there is an easy way to enable this... |
Beta Was this translation helpful? Give feedback.
-
I achieved something along these lines like so. Created
Then created
|
Beta Was this translation helpful? Give feedback.
-
Has anyone else managed to add tags to the post metadata similar to how papermodx does it? |
Beta Was this translation helpful? Give feedback.
-
I hope everyone has figured out how to add tags on preview list, but if not, I'd like to share my method. As mentioned before, you need to overwrite the default list.html, that PaperMod provides.
{{- if .Params.tags }}
<div class="tags" style="padding: 2px;">
<div style="display: flex; flex-wrap: wrap; justify-content: flex-end; margin-top: 5px;">
{{ range .Params.tags }}
<a href="/tags/{{ . | urlize }}" style="margin-right: 5px;
color: white;
background-color: rgb(55, 162, 121);
border-radius: 6px;
padding: 1px 12px; ">
{{ . }}
</a>
{{ end }}
</div>
</div>
{{- end }} Note: You can place this snippet anywhere inside the article. I placed it after the main content. You can see it here. If you'd like to see how it works on the real blog, click here. |
Beta Was this translation helpful? Give feedback.
-
Hi, I want to display tags in the post list (in
layouts/_defaults/list.html
), but I can't figure out how to do it.I tried adding in the code used in
layouts/_defaults/single.html
for tags to thelist.html
file, but this fails to show the tags on the list page.Do I need create a partial and insert it into the list layout file?
Could anyone help me out on this one, please?
Beta Was this translation helpful? Give feedback.
All reactions