I deployed some changes to the site today:
- Removed Twitter integration
- Fixed a bug preventing Bookmark (Link) posts from syndicating to mastodon
- Fixed an RSS feed warning about photo posts having a relative URL
Removed Twitter integration
Even though I’ve been off Twitter for a while now, I still had a bunch of code from when I was syndicating. All of that is gone.
This started as taking care of deprecation warnings while I prepare to upgrade my Django version. One of those warnings, though, was from tweepy. Since I had removing the integration on my to-do list anyways, I just went ahead and removed tweepy and all of the other Twitter related stuff.
427 lines of code removed.
Bookmark to Mastodon bug
When I updated how Bookmarks render markdown to text I introduced a bug where the to_mastodon_status
method once was accessing a property but now a method. The fix was straightforward.
if self.has_quote():
- content = "“" + self.quote_txt + "”\n\n"
+ content = "“" + self.quote_txt() + "”\n\n"
if self.has_commentary():
- content = content + self.commentary_txt + "\n\n"
+ content = content + self.commentary_txt() + "\n\n"
RSS contained relative URL
I don’t remember the exact language from the RSS validator, nor do I remember why I validated my feed to begin with, but it gave a warning around photo post content having relative URLs.
Every feed item has a get_absolute_url
method that returns a root-relative URL, but they also have a get_permalink
method that adds includes the protocol and domain as well. Fixing this was a matter of swapping out those methods in the template:
<div class="article-content">
- <a href="{{ photo.get_absolute_url }}"><img height="{{ photo.image_height }}" width="{{ photo.image_width }}" class="u-photo" src="{{ photo.image.url }}" alt="{{ photo.alternative_text }}"></a>
+ <a href="{{ photo.get_permalink }}"><img height="{{ photo.image_height }}" width="{{ photo.image_width }}" class="u-photo" src="{{ photo.image.url }}" alt="{{ photo.alternative_text }}"></a>
<div class="e-content">{{ photo.caption_html|safe }}</div>
</div>