Skip to content

Instantly share code, notes, and snippets.

@danott
Created January 18, 2024 16:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danott/f5fc2928e13136a24a7680b8c85d726d to your computer and use it in GitHub Desktop.
Save danott/f5fc2928e13136a24a7680b8c85d726d to your computer and use it in GitHub Desktop.
Hypothetical markup for HTML based feeds. Riffing on the ideas shared at https://blog.jim-nielsen.com/2024/rss-in-html/
<!DOCTYPE html>
<!--
This is hypothetical markup for HTML based feeds.
Riffing on the ideas shared at https://blog.jim-nielsen.com/2024/rss-in-html/
-->
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Dan Ott's HTML Feed</title>
<!-- Tell the machines that there's an HTML feed available at /feed.html -->
<link
rel="alternate"
type="application/rss+html"
title="Dan Ott's HTML Feed"
href="/feed.html"
/>
<meta name="author" value="Dan Ott" />
<meta
name="description"
value="A slightly longer description about Dan Ott's HTML Feed"
/>
</head>
<body>
<article id="stable_id:1">
<header>
<h1>A post authored on January 1st</h1>
<time datetime="2024-01-01">January 1, 2024</time>
</header>
<p>
The text content of the &lt;h1&gt; is the post title. The
<code>datetime</code> attribute of the <code>&lt;time&gt;</code> element
is the post tile. The text content of the <code>datetime</code> is
purely ornamental for viewing the feed in the browser.
</p>
<p>
Everyting outside of the <code>&lt;header&gt;</code> element is the post
content.
</p>
<p>This paragraph? That's content too.</p>
</article>
<article id="stable_id:2">
<header>
<h1>A post authored on January 3rd</h1>
<time datetime="2024-01-03">3 JAN 2024</time>
</header>
<main>
<p>
Another approach could be wrapping the content in an
<code>&lt;main&gt;</code> element. It could make things
<em>easier</em> for a parser. But computers are doing the parsing so
why add extraneous markup?
</p>
</main>
</article>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment