<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="3.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:atom="http://www.w3.org/2005/Atom">
  <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
  <xsl:template match="/">
  <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
    <head>
      <title>
        RSS Feed | <xsl:value-of select="/atom:feed/atom:title"/>
      </title>
      <link rel="stylesheet" href="../css/index.css"/>
      <link rel="stylesheet" href="../css/webfonts/webfonts.css"/>
    </head>
    <body>
			<main>
				<p>
					<i>This is an RSS feed. Subscribe by copying the URL from the address bar into your newsreader. Don't have a newsreader? <a href="../about-feeds/">Learn more and get started</a>. It’s free.</i>
				</p><hr />
				<h1>RSS Feed Preview</h1>
				<p class="nodropcap page-block">Here's the sort of thing you'll see in your newsreader when you subscribe. Done here? <a href="../">Go back to nathanupchurch.com</a></p>
				<h2>Latest posts</h2>
				<xsl:for-each select="/atom:feed/atom:entry">
					<article class="postlist-item">
						<a class="postlist-link">
							<xsl:attribute name="href">
								<xsl:value-of select="atom:link/@href"/>
							</xsl:attribute>
							<div class="post-image-container">
								<img class="post-image">
									<xsl:attribute name="src">
										<xsl:value-of select="atom:image/atom:url" />
									</xsl:attribute>
								</img>
							</div>
						</a>
						<div class="post-copy">
							<a class="postlist-link">
								<xsl:attribute name="href">
									<xsl:value-of select="atom:link/@href"/>
								</xsl:attribute>
								<h3>
									<xsl:value-of select="atom:title"/>
								</h3>
							</a>
							<time class="postlist-date">
								<xsl:attribute name="datetime">
									<xsl:value-of select="substring(atom:updated, 0, 11)" />
								</xsl:attribute>
								<xsl:value-of select="substring(atom:updated, 0, 11)" />
							</time>
							<p>
								<xsl:value-of select="atom:description" />
							</p>
						</div>
					</article>
				</xsl:for-each>
			</main>
    </body>
    </html>
  </xsl:template>
</xsl:stylesheet>