Skip to content

Commit

Permalink
Don't duplicate the tags
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Jul 11, 2024
1 parent 55dd5ef commit e12041d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 30 deletions.
25 changes: 1 addition & 24 deletions blog/feeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,7 @@ def item_title(self, item):
return item.title

def item_description(self, item):
tags = ", ".join(
f'<a href="https://simonwillison.net/tags/{tag.tag}">{tag.tag}</a>'
for tag in item.tags.all()
)
return f"{item.body}<p>Tags: {tags}</p>"
return item.body


class Blogmarks(Base):
Expand All @@ -66,13 +62,6 @@ def items(self):
def item_title(self, item):
return item.link_title

def item_description(self, item):
tags = ", ".join(
f'<a href="https://simonwillison.net/tags/{tag.tag}">{tag.tag}</a>'
for tag in item.tags.all()
)
return f"{item.commentary}<p>Tags: {tags}</p>"


class Everything(Base):
title = "Simon Willison's Weblog"
Expand Down Expand Up @@ -103,18 +92,6 @@ def item_title(self, item):
else:
return "Quoting %s" % item.source

def item_description(self, item):
tags = ", ".join(
f'<a href="https://simonwillison.net/tags/{tag.tag}">{tag.tag}</a>'
for tag in item.tags.all()
)
if isinstance(item, Entry):
return f"{item.body}<p>Tags: {tags}</p>"
elif isinstance(item, Blogmark):
return f"{item.commentary}<p>Tags: {tags}</p>"
else:
return f"{item.quotation}<p>Tags: {tags}</p>"


class SeriesFeed(Everything):
ga_source = "series"
Expand Down
6 changes: 0 additions & 6 deletions templates/feeds/everything.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@
{% endif %}
{% elif obj.is_blogmark %}
{% include "feeds/blogmark.html" %}
{% if obj.tags.count %}
<p>Tags: {% for tag in obj.tags.all %}<a href="https://simonwillison.net/tags/{{ tag.tag }}">{{ tag.tag }}</a>{% if not forloop.last %}, {% endif %}{% endfor %}</p>
{% endif %}
{% elif obj.is_quotation %}
{% include "feeds/quotation.html" %}
{% if obj.tags.count %}
<p>Tags: {% for tag in obj.tags.all %}<a href="https://simonwillison.net/tags/{{ tag.tag }}">{{ tag.tag }}</a>{% if not forloop.last %}, {% endif %}{% endfor %}</p>
{% endif %}
{% endif %}

0 comments on commit e12041d

Please sign in to comment.