tag-feed.js

Last updated:

Embed a site’s /tag/<tag> page into any page on the same domain, with batch loading as you scroll.

How to use

You will have to make sure that in your configurations you have tags setup and that configuration should look like this: Then create a new weblog page with the following code in it (update the tag for your specific tag):

<div
  id="tag-feed"
  data-tag="running"
  data-batch-size="10"
  data-concurrent="4"
  data-show-status="true"
  data-hide-tags="true">Loading...</div>

<script src="https://scripts.brebs.net/tag-feed/tag-feed.js"></script>

Options

What this script does

  1. Fetches the tag page at /tag/<tag> (example: /tag/running)
  2. Parses its list of posts (expects: <article><ul><li><a>... <i>DATE</i></li>...</ul></article>)
  3. Renders posts in batches as you approach the bottom (“infinite scroll”)
  4. Limits concurrent post fetches so fast scrolling doesn’t hammer servers
  5. Optionally shows load status at the top

Get the script

You can use the hosted version directly:

<script src="https://scripts.brebs.net/tag-feed/tag-feed.js"></script>

Self-hosting (if you like doing that)

If you prefer to host the script yourself, you can copy the source and host it anywhere that serves raw JavaScript.

One easy option is use omg.lol amazing service of paste.lol.

  1. Copy or download the code of tag-feed.js
  2. Create a new paste at paste.lol
  3. Name it something like tag-feed.js
  4. Use the /raw version of the paste as your script source

Example:

<script src="https://ericmwalk.paste.lol/tag-feed.js/raw"></script>
The /raw endpoint serves the JavaScript directly, so it can be used just like any other hosted script.