]> git.bts.cx Git - cx.git/blob - cx/templates/public/atom.php
post metadata support (not very good yet)
[cx.git] / cx / templates / public / atom.php
1 <?= '<?xml version="1.0" encoding="utf-8"?>'."\n" /* So some installs of PHP don't get confused... */ ?>
2 <feed xmlns="http://www.w3.org/2005/Atom">
3 <id><?= cx_url_site('/'); ?></id>
4
5 <title><?= cx_site_name(); ?></title>
6 <subtitle><?= cx_site_byline(); ?></subtitle>
7
8 <?php foreach (cx_posts_get(limit: 1) as $post): ?>
9 <updated><?= date(DATE_RFC3339, $post->date) ?></updated>
10 <?php endforeach; ?>
11
12 <link href="<?= cx_url_site('/feed/'); ?>" rel="self" type="application/atom+xml" />
13 <link href="<?= cx_url('/'); ?>" rel="alternate" type="text/html" />
14
15 <author>
16 <name><?= cx_site_author() ?></name>
17 </author>
18
19 <?php foreach (cx_posts_get() as $post): ?>
20 <?php $post_permalink = '/' . date('Y', $post->date) . '/' . date('m', $post->date) . '/' . $post->slug; ?>
21 <entry>
22 <id><?= cx_url_site($post_permalink); ?></id>
23 <title><?= $post->title ?></title>
24 <updated><?= date(DATE_RFC3339, $post->date) ?></updated>
25 <link href="<?= cx_url($post_permalink) ?>" rel="alternate" type="text/html" />
26 <content type="xhtml">
27 <div xmlns="http://www.w3.org/1999/xhtml">
28 <?= $post->html_content ?>
29 </div>
30 </content>
31 </entry>
32 <?php endforeach; ?>
33
34 </feed>