diff --git a/templates/themes/catalog/index.rss b/templates/themes/catalog/index.rss new file mode 100644 index 00000000..c187e45a --- /dev/null +++ b/templates/themes/catalog/index.rss @@ -0,0 +1,19 @@ + + + + /{{ board.uri }}/ - {{ board.title|e }} + https://8ch.net/{{ board.uri }}/ + Live feed of new threads on the 8chan board /{{ board.uri }}/ - {{ board.title|e }}. + + {% for post in recent_posts %} + + {% if post.subject %}{{ post.subject|e }}{% else %}{{ post.body_nomarkup[:256]|e }}{% endif %} + https://8ch.net/{{ board.uri }}/res/{{ post.id }}.html + https://8ch.net/{{ board.uri }}/res/{{ post.id }}.html + https://8ch.net/{{ board.uri }}/res/{{ post.id }}.html + {{ post.pubdate }} + {{ post.body }} ]]> + + {% endfor %} + + diff --git a/templates/themes/catalog/theme.php b/templates/themes/catalog/theme.php index c7a8ee95..239d4dff 100644 --- a/templates/themes/catalog/theme.php +++ b/templates/themes/catalog/theme.php @@ -93,6 +93,7 @@ } if (empty($post['image_count'])) $post['image_count'] = 0; + $post['pubdate'] = date('r', $post['time']); $recent_posts[] = $post; } @@ -113,5 +114,11 @@ 'board' => $board_name, 'link' => $config['root'] . $board['dir'] ))); + + file_write($config['dir']['home'] . $board_name . '/index.rss', Element('themes/catalog/index.rss', Array( + 'config' => $config, + 'recent_posts' => $recent_posts, + 'board' => $board + ))); } };