Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tag Feeds + Feed Improvements #331

Merged
merged 4 commits into from Dec 8, 2021
Merged

Tag Feeds + Feed Improvements #331

merged 4 commits into from Dec 8, 2021

Conversation

seancdavis
Copy link
Owner

@seancdavis seancdavis commented Dec 8, 2021

There are a number of things going on here:

New Tag Feeds

There is now an XML feed for every tag on the site. This fixes #105. It also sets up #48 for being able to add a link to follow the topic, as well as #310 in setting up more enhanced "topics" for the future.

Tag feeds are located at /blog/tag/[tag]/feed.xml.

As a bonus, this doesn't introduce any new referential logic. I was able to get this working using object associations and collections that were already in place.

This method has what I originally thought to be a drawback, which is that it must respect the pagination rules of the tag page. However, this seems okay to me. Tag content doesn't change rapidly enough to make a difference. And if it started to, I'd likely also increase the pagination size.

I will want to run a test on feedly after this is deployed to ensure it all worked as I expect it to.

Debugging Helpers

There was a debug filter that ran JSON.stringify() on the input and printed to the screen. This doesn't always work. There are some circularly-dependent objects in Eleventy. Sometimes logging to the console is a better move.

In addition, I've found that I often want to look at the shape of the objects being printed without needing to get all the values (values can be big).

Now there are three debugging filters:

  • console: Logs the entire input to the console.
  • console.keys: Logs the keys of the object to the console.
  • print: Runs JSON.stringify() on the object and renders it on screen.

Site Feed Improvements

I also noticed that the author wasn't being rendered in the feed, so I added that, which now supports guest authors. I'll have to test to see the effect this has in various readers, but it should get the job done.

And last, I have truncated the main feed to only 20 items. In normal times, that's about 1-2 months of content. Eventually it might not be as much and I'll have to expand. But it should work great for now, and cut down slightly on build time for that particular file.

- console: logs to console
- console.keys: logs object's keys to the console
- print: runs JSON.stringify() and renders result on the page
@seancdavis seancdavis added enhancement New feature or request feature: blog Affects blog posts or listing pages labels Dec 8, 2021
@seancdavis seancdavis added this to In progress in Reader Retention via automation Dec 8, 2021
@seancdavis seancdavis merged commit 106e8f7 into main Dec 8, 2021
Reader Retention automation moved this from In progress to Done Dec 8, 2021
@seancdavis seancdavis deleted the tag-feeds branch December 8, 2021 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature: blog Affects blog posts or listing pages
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Add RSS feed to /blog and all /tag pages
1 participant