Disable feed validation, add setting to enable

This commit is contained in:
Cadence Fish
2020-02-18 20:42:36 +13:00
parent 6d7e089dae
commit 21ec920516
4 changed files with 14 additions and 11 deletions

View File

@@ -1,9 +1,10 @@
mixin feed_link(name, urlPart, username, contentType)
mixin feed_link(name, urlPart, username, contentType, display_feed_validation_buttons)
span
a(rel="alternate" type=contentType href=`/u/${username}/${urlPart}.xml`)
= name
sup.validate-feed
-
let params = new URLSearchParams()
params.set("url", `${website_origin}/u/${username}/${urlPart}.xml`)
a(href="https://validator.w3.org/feed/check.cgi?"+params.toString() title="Validate this feed") v!
if display_feed_validation_buttons
sup.validate-feed
-
let params = new URLSearchParams()
params.set("url", `${website_origin}/u/${username}/${urlPart}.xml`)
a(href="https://validator.w3.org/feed/check.cgi?"+params.toString() title="Validate this feed") v!

View File

@@ -1,4 +1,4 @@
//- Needs user, url, constants, website_origin
//- Needs user, url, constants, website_origin, display_feed_validation_buttons
include includes/timeline_page.pug
include includes/next_page_button.pug
@@ -44,8 +44,8 @@ html
div.profile-counter #[span(data-numberformat=user.followedBy).count #{numberFormat(user.followedBy)}] followed by
div.links
if constants.settings.rss_enabled
+feed_link("RSS", "rss", user.data.username, "application/rss+xml")
+feed_link("Atom", "atom", user.data.username, "application/atom+xml")
+feed_link("RSS", "rss", user.data.username, "application/rss+xml", display_feed_validation_buttons)
+feed_link("Atom", "atom", user.data.username, "application/atom+xml", display_feed_validation_buttons)
a(rel="noreferrer noopener" href=`https://www.instagram.com/${user.data.username}`) instagram.com
- const hasPosts = !user.data.is_private && user.timeline.pages.length && user.timeline.pages[0].length