Tools Content Design
This page describes the Tools collection Listsome builds today. The decision record holds the decision behind it.
Goal
A maker keeps a curated list of tools they own, shares why each one is worth having, and earns a commission when a reader buys through a configured link. The maker writes the affiliate identifier once and writes ordinary product links in each tool file. The build applies the identifier.
The old site at yourpalryan.com is the model. It had a Tools index, one page per
tool, a brand label, a short review, a direct purchase link, and an updated
date. Each old file held only a title and a link field. A level two heading
carried the brand, and the listing derived its blurb from the body. The new
version keeps that low ceremony and moves the affiliate link out of each file
and into configuration.
What stays out
- Tool lists inside project pages. Issue #79 covers that feature, and it uses a different shape: a checklist derived from a Markdown list. This proposal adds a separate collection.
- Affiliate rewriting in project bodies, materials tables, or downloads. Decision record 0004 cut that feature and this proposal leaves it cut.
- Categories, feeds, and a search index for tools. A tool is a short curated entry, not a dated post. The old collection had an author sidebar and share links, and those stay out. A tool can carry an image and tags, and decision record 0010 replaced the single product link with an ordered list of purchase options.
- Platform support beyond Amazon. The configuration shape leaves room for more platforms, and the first release recognizes Amazon alone.
Content format
A tool lives in tools/<slug>/index.md, beside the projects/ directory. The
frontmatter names the tool, its maker, and the product page:
---
title: Tablesaw
affiliate:
- title: Amazon
url: https://www.amazon.com/dp/B07EXAMPLE
---
I upgraded from a lower end contractor saw. The fence holds its setting and
the dust ports fit my shop vacuum.
Listsome requires title. The fields slug, brand, description,
updated_at, image, tags, and affiliate are optional. affiliate is an
ordered list of purchase options, each a store title and a url. A tool with
no entries is a write-up with nothing to buy. A missing slug
comes from the title. With no description, the listing uses the first
paragraph of the body, which is how
the old site derived its blurb. A missing brand prints no brand label. The
body is ordinary CommonMark, rendered with the same options a project body
uses. Unknown frontmatter keys produce a warning that names the file and the
key, matching the behavior project files already have.
The old file put the brand in a level two heading. This format moves it into frontmatter so the listing can show it without parsing body headings. That’s a deliberate departure from the old file shape, not a loss of information.
An image is a full URL or a path under the site’s assets/ directory. The
tools index lays it out to the left of the title, brand, and blurb. A tags
list adds links to static filter pages. For example, tags: ["Woodworking"]
puts the tool at /tools/tag/woodworking/, and /tools/tags/ lists every tag
with a count. The build needs no JavaScript for the filtering.
When a tool file fails to parse, the build warns with its path and leaves it out of the site. Issue #84 records the silence this avoids for projects.
Affiliate configuration
The site owner puts the Amazon identifier in listsome.toml:
[affiliates]
disclosure = "Some links earn me a commission at no cost to you."
[affiliates.amazon]
tag = "ryanparsley-20"
| Field | Default | What Listsome does with it |
|---|---|---|
affiliates.disclosure | A built in sentence | Prints before each tool’s Purchase line |
affiliates.amazon.tag | None | Sets the tag parameter on Amazon product links |
With no [affiliates.amazon] table, product links render as the author wrote
them. An empty tag is a configuration error that names the field. A key under
[affiliates] that Listsome doesn’t recognize is also a configuration error,
so a typo can’t look like a working setting.
How Listsome resolves a link
Resolution is a pure transform from one purchase option’s URL and the affiliate
configuration to a rendered link, applied to each entry in affiliate:
- When the URL points at an Amazon storefront, Listsome sets the
tagquery parameter to the configured value. Listsome replaces an existing tag, keeps the other parameters and the fragment, and marks the link as sponsored. - Any other URL, including a minted
AliExpresss.clicklink, prints exactly as written. It’s still a sponsored link, but Listsome never adds a tag it can’t mint for that store. - A non-Amazon host, a relative path, or a URL that won’t parse renders as written.
- With no
[affiliates.amazon]table, Amazon URLs render untagged too. - Every option carries
rel="sponsored nofollow", because an affiliate entry is a referral by intent. A write-up with nothing to buy lists no options.
Amazon storefront hosts come from a fixed list that covers the www. and
smile. forms of the country domains. A host that merely starts with
amazon. doesn’t qualify, so a lookalike domain never receives the tag.
Resolution uses a URL parser rather than string concatenation. The operation is idempotent: applying it twice gives the same link.
Generated pages
| Path | Contents |
|---|---|
/tools/ | Tag filters, disclosure, then one page of tools with a thumbnail, brand, title linked to the resolved URL, description, and a permalink |
/tools/page/<n>/ | Later pages of the tool listing |
/tools/<slug>/ | Brand, title, rendered body, Purchase options, updated date, disclosure, and a link back to the index |
/tools/tags/ | The first page of tool tags, each with its tool count |
/tools/tags/page/<n>/ | Later pages of the tag index |
/tools/tag/<tag>/ | The first page of tools carrying one tag |
/tools/tag/<tag>/page/<n>/ | Later pages of that tag filter |
items_per_page splits /tools/, /tools/tags/, and each /tools/tag/<tag>/
listing. The build writes later pages under page/<n>/ beside the first page,
and every page links to the one before it and after it. A listing that fits on
one page prints no page links.
Affiliate links carry rel="sponsored nofollow". Ordinary product links carry
no rel value. The disclosure is visible before the first affiliate link on
each page, and the site owner can replace the wording in configuration.
The site header gets a Tools link when the build discovers at least one tool. A site with no tools keeps its current header. Tool links stay out of the Atom feed and out of the webmention manifest, since a purchase link doesn’t answer a mention.
Data flow
- Configuration loading parses
[affiliates]and rejects bad values. - Tool discovery reads each index file and warns about the ones it skips.
- Link resolution applies the preceding rules to each product URL.
- A tool context carries the resolved link, the sponsored flag, the rendered body, and the permalink to the template renderer.
- The generator writes the index page and one page per tool, then reports the tool count beside the project count.
listsome new-tool <name>writes a starter file undertools/.listsome checkvalidates tool files as well as project files.
The parser, the resolver, and the context builder stay pure. File reading and writing stay in the shell, as they do for projects today.
Testing
- Unit tests check link resolution with an Amazon tag, with the replacement of an existing tag, with other parameters and the fragment kept, with a non Amazon host, with a short link, with a broken URL, with no configuration, with an explicit override, and with an opt out.
- Parser tests for required fields, the derived slug, the override forms, and the warning for an unknown key.
- Renderer tests for both pages, the sponsored attribute, the disclosure, and an empty index when no tools exist.
- A
tools/tablesaw/index.mdfile inexamples/basic, with snapshots for/tools/and/tools/tablesaw/. The diff must stay additive so existing project output doesn’t move.
Migrating the old site
Each old tool becomes an index file. title stays. The old link field
becomes a single affiliate entry, {title: Amazon, url: …}. The level two
brand heading becomes brand frontmatter,
and the review paragraph stays as the body. The old listing derived its blurb
from the body, so a new description is optional. The old amzn.to link needs
its canonical Amazon product URL before it can carry a configured tag. That
conversion is the one manual step in the migration.
Deferred questions
- Should a purchase option ever be non-sponsored, a vendor page the author doesn’t earn from, or does that case just mean the tool lists no option?
- The old site had a Shop link in its navigation. Should listsome gain site level navigation links, or does the Tools page carry that job?
- Should the planned project tool list in issue #79 reuse this model once it lands, or stay as plain links?
The build settled two earlier questions. Purchase options live in the
affiliate list rather than the old single link field, and tool pages stay
out of the Atom feed.