Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing atom:link with rel="self" #172

Open
SiqueiraX opened this issue May 3, 2022 · 1 comment
Open

Missing atom:link with rel="self" #172

SiqueiraX opened this issue May 3, 2022 · 1 comment

Comments

@SiqueiraX
Copy link

SiqueiraX commented May 3, 2022

image

My code

`
//feed
const feed = new Feed ({
title: "Semente Feed",
description: "O Feed RSS da Semente da Liberdade!",
id: "https://sementedaliberdade.com.br/",
link: "https:sementedaliberdade.com.br/",
language: "pt-BR",
image: "https://sementedaliberdade.com.br/images/SDL-05.png",
favicon: "https://sementedaliberdade.com.br/images/SDL-05.png",
update: new Date(),
generator: "awesome",
feedLinks: {
json: "https://sementedaliberdade.com.br/json",
atom: "https://sementedaliberdade.com.br/atom"
}
})

app.get("/feed", (req, res) => {
Post.find({approved: true}).lean().then((posts) => {
posts.forEach(post => {
feed.addItem({
title: post.title,
id: "https://sementedaliberdade.com.br/article/" + post.slug,
link: "https://sementedaliberdade.com.br/article/" + post.slug,
description: "Mais um artigo da Semente da Liberdade!",
content: post.content,
date: post.date,
image: "https://sementedaliberdade.com.br/uploads/images/" + post.img
})
})
res.set('Content-Type', 'text/xml')
res.send(feed.rss2())
})

app.get("/atom", (req, res) => {
res.set('Content-Type', 'text/xml')
res.send(feed.atom1());
});

app.get("/json", (req, res) => {
res.set('Content-Type', 'text/xml')
res.send(feed.json1());
});
`

@sking-cais
Copy link

I was looking for this as well and discovered that it's derived from using either feed or feedLinks.rss.

Example:

const feed = new Feed({
  ...
  feedLinks: {
    rss: 'https://....'
  },
  feed: 'https://....'
})

See

const atomLink = options.feed || (options.feedLinks && options.feedLinks.rss);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants