From 47877e71d415cd9f1977483d52c6b6e63cc44257 Mon Sep 17 00:00:00 2001 From: DeaDvey Date: Wed, 30 Jul 2025 01:09:51 +0100 Subject: [PATCH] atom functionality is added and I fixed an issue in the RSS that is caused by the deleted posts not having valid data. --- README.md | 3 +-- views/syndication/global_atom.ejs | 14 ++++++++++++++ views/syndication/global_rss.ejs | 4 +++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 073612d..80e46b7 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Read the [configuation guide](docs/CONFIG.md) for configuration help (in config. * post creation via the web frontend (no need to remote to your server to make a post) * multi user * powerful customisation -* rss +* rss, atom * timeline, user page, post page and tag specific page * edit/delete posts * hitcount @@ -33,7 +33,6 @@ Read the [configuation guide](docs/CONFIG.md) for configuration help (in config. # Planned features/todo list * user specific RSS feeds -* atom * federation (looks tricky) * All strings (including in edit and post page) customisable * formatable custom strings diff --git a/views/syndication/global_atom.ejs b/views/syndication/global_atom.ejs index 1c170af..9c72cd0 100644 --- a/views/syndication/global_atom.ejs +++ b/views/syndication/global_atom.ejs @@ -5,4 +5,18 @@ <%= config.site_description %> <%= new Date() %> <%= config.site_url %> + <% for (let postID = posts.length-1; postID >= 0; postID--) { %> + <% if (posts[postID]["deleted"] != true) { %> + + <%= posts[postID]["title"] %> + <%= config.site_url %>/post/<%= postID %> + ]]> + <%= config.site_url %>/post/<%= postID %> + <%# func.unix_time_to_atom_date(posts[postID]['pubdate']) %> + <% for (let tag_index = 0; tag_index < posts[postID]['tags'].length; tag_index++) { %> + ]]> + <% } %> + + <% } %> + <% } %> diff --git a/views/syndication/global_rss.ejs b/views/syndication/global_rss.ejs index 73e43e6..d919514 100644 --- a/views/syndication/global_rss.ejs +++ b/views/syndication/global_rss.ejs @@ -5,10 +5,11 @@ <%= config.site_url %> <%= config.site_description %> <% for (let postID = posts.length-1; postID >= 0; postID--) { %> + <% if (posts[postID]["deleted"] != true) { %> <%= posts[postID]["title"] %> <%= config.site_url %>/post/<%= postID %> - ]]> + ]]> <%= config.site_url %>/post/<%= postID %> <%= func.unix_time_to_rss_date(posts[postID]['pubdate']) %> <% for (let tag_index = 0; tag_index < posts[postID]['tags'].length; tag_index++) { %> @@ -16,5 +17,6 @@ <% } %> <% } %> + <% } %>