tag-feed.js
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
data-tag— Required. Tag slug, likerunning.data-batch-size— how many posts to load per batch (default: 10).data-concurrent— max concurrent fetches while scrolling (default: 4).data-show-status— show/hide load status (default: true). Set tofalseto hide.data-hide-tags— hide tags in post output (default: true). Set tofalseto show.
What this script does
- Fetches the tag page at
/tag/<tag>(example:/tag/running) - Parses its list of posts (expects:
<article><ul><li><a>... <i>DATE</i></li>...</ul></article>) - Renders posts in batches as you approach the bottom (“infinite scroll”)
- Limits concurrent post fetches so fast scrolling doesn’t hammer servers
- 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.
- Copy or download the code of
tag-feed.js - Create a new paste at
paste.lol - Name it something like
tag-feed.js - Use the
/rawversion 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.