Atom to HTML!
I can blog now!
Update: I no longer use this script and as such won't update it any further. Something like a static website generator is better fit for the intended purpose of this script
Why?
There's an unwritten rule in programming, or in general really, that you Don't Repeat Yourself (DRY). And there's also a cool thing named Atom that allows you to read &or get notified of new weblogs and stuff like that in one place. And it's really cool! But some people that have an RSS or an Atom feed update it indepenandtly from their blogs, having to repeat themselves or getting lazy and not updating them
The solution that I'm definitely not the first one to do is to link the feed and the website somehow. In my case the feed now dictates the blog index list. I've built a javascript script that takes an Atom feed and converts it into list elements. You're free to use it, take a look!
Usage
As of version 1.1:
- Download the script and put it somewhere on your server
- Edit the
feedUrlvariable &or check that relative links work correctly! - Embed the script on your page, something like
<script src="/shared/feed2list.js"></script> - Identify your list element with a
feedlistid and your script element with af2lselfid
And it should work! If the title of an entry is a ISO 8601 date with no time, it will just display a date, otherwise, it will display a date and the entry title
Example:
<body>
...
<main>
<nav><ul id="feedlist"/></nav>
</main>
...
<script id="f2lself" src="/shared/feed2list.js"/>
</body>