Href Pager documentation
Learn how to craft pager links manually, validate them, and share them with confidence—even without the hosted encoder UI.
How pager links are structured
Every HREF Pager URL has two independent payloads:
-
#data=fragment – required. Contains the Markdown body after raw DEFLATE compression and URL-safe Base64 encoding. -
?m=metadata – optional. Present only when at least one metadata field or toggle contributes output. The payload is the compressed, Base64URL-encoded JSON metadata object.
When a checksum is included in the metadata, it is calculated from the literal #data fragment string
(normally the first 10 characters of a SHA-256 hash). The viewer inflates both payloads in the browser, validates
the checksum when present, and renders the Markdown with hostile content stripped.
Create a link manually
-
Write your Markdown and save it as UTF-8 text. Compress the bytes with raw DEFLATE, then encode
using URL-safe Base64 (replace
+with-,/with_, and trim any trailing=). This becomes the#data=fragment. -
Build a metadata object. At minimum include
{ "v": 1 }. Addtitle,author,email, anddateonly when you have values. If you plan to ship a checksum, compute a short hash (10 characters by default) from the literal fragment string produced in step 1 and store it under"h". -
If the metadata object still only contains
v, you can omit?m=entirely. Otherwise, UTF-8 encode the JSON, compress with raw DEFLATE, Base64URL encode the result, and place it in?m=<payload>. -
Assemble the final URL:
https://your-host/index.html, append the metadata query string (when not empty), and finish with#data=<payload>. Add?edit=1if you want the encoder to load with the content prefilled for editing.
Example layout:
https://example.com/index.html?m=<metadata>#data=<markdown>
Popular tooling includes pako for compression and
the Web Crypto API (crypto.subtle.digest) for hashing. Make sure you call encodeURIComponent
if you embed the final link inside another context.
Prompt an LLM to produce pager links
Share this prompt with your favorite model when you want it to emit a ready-to-open link:
Compress the metadata JSON and Markdown below separately using raw DEFLATE, then encode each with URL-safe Base64.
Return a link in the format https://hrefpager.app/index.html?m=<metadata>#data=<markdown> with no line breaks.
Do not include explanations—only the final URL, and ensure the metadata hash matches the #data fragment.
Metadata to encode:
{ "v": 1, "title": "...", "author": "...", "email": "...", "date": "...", "h": "short hash of the #data fragment" }
Markdown to encode:
<your content here>
Verifying a link
- Ensure the query string includes
?m=and the fragment begins with#data=. - Check that both encoded payloads contain only URL-safe Base64 characters.
- Decode both payloads locally to confirm the metadata JSON parses, the short hash matches the fragment string, and the Markdown renders as expected.