0

我正在使用 FeedGenerator ( https://feedgen.kiesow.be/ ) 在烧瓶中生成我的原子提要,它看起来对我来说是正确的。当我在 Feedly 中添加提要时,没有链接,“直接在网站中打开”转到 Feedly 404 页面。这是我在烧瓶中生成提要的路线:

def rss():
    rss_url = 'https://www.example.com/rss'
    base_url = 'https://www.example.com'
    
    fg = FeedGenerator()
    fg.id(rss_url)
    fg.title('MysSite Feed')
    fg.description('My site description')
    fg.link(href='https://www.example.com')

    for article in get_rss_posts():
        fe = fg.add_entry()
        fe.title(article.title)
        fe.link(href=base_url+'/post/'+article.slug)
        fe.content(article.body)
        fe.summary(article.short_desc)
        fe.id(base_url+'/post/'+article.slug)
        fe.author(name=article.author.username)
        fe.pubDate(article.timestamp.astimezone(timezone('America/Chicago')))

    return Response(fg.atom_str(pretty=True), mimetype="application/atom+xml; charset=utf-8")```

My generated feed when viewed in Chrome:

<?xml version='1.0' encoding='UTF-8'?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <id>https://www.example.com/rss/devops</id>
  <title>Example - devops Feed</title>
  <updated>2021-04-08T21:13:58.427520+00:00</updated>
  <link href="https://www.example.com"/>
  <generator uri="https://lkiesow.github.io/python-feedgen" version="0.9.0">python-feedgen</generator>
  <subtitle>Example is your source for devops posts.</subtitle>
  <entry>
    <id>https://www.example.com/post/uptime-robot</id>
    <title>Uptime Robot</title>
    <updated>2021-04-08T21:13:58.445502+00:00</updated>
    <author>
      <name>ExampleAdmin</name>
    </author>
    <content>&lt;h4&gt;I Needed A Monitor To Check Uptime&lt;/h4&gt;&#13;
&lt;p&gt;I needed a website monitoring service for Example that let me know if it went down. There are a many options but I only found one that met all of my needs:&lt;/p&gt;&#13;
&lt;ul&gt;&#13;
&lt;li&gt;&lt;strong&gt;Free -&lt;/strong&gt; I'm running this site on a budget so I need a service that's reliable but doesn't cost me anything&lt;/li&gt;&#13;
&lt;li&gt;&lt;strong&gt;SMS and Email messaging -&lt;/strong&gt; I need a service that emails and texts me if my site goes offline&lt;/li&gt;&#13;
&lt;li&gt;&lt;strong&gt;Easy to use -&lt;/strong&gt; I need something simple that I can just set and forget&lt;/li&gt; &#13;
&lt;li&gt;&lt;strong&gt;Allows for multiple monitors -&lt;/strong&gt; 1 just won't cut it&lt;/li&gt;&#13;
&lt;/ul&gt;&#13;
&lt;h4&gt;Verdict&lt;/h4&gt;&#13;
&lt;p&gt;&lt;a href="https://uptimerobot.com/" target="_blank"&gt;Uptime Robot&lt;/a&gt; met all of my needs and did I mention that they have a free option? If you need a bit more they have a cheap monthly plan too. Currently, the free plan is working for me.&lt;/p&gt;&#13;
&lt;p&gt;Uptime Robot gets a Pass from me! &lt;/p&gt;&#13;
&lt;p&gt;&lt;b class="icon solid fa-fire iof-fire"&gt;&amp;nbsp;&lt;/b&gt;&lt;/p&gt;</content>
    <link href="https://www.example.com/post/uptime-robot" rel="alternate"/>
    <summary>&lt;p&gt;Need a tool to monitor your website's uptime? See our top recommendation!&lt;/p&gt;</summary>
    <published>2021-02-18T16:57:22-06:00</published>
  </entry>
</feed>

This is a Feedly link on my website that allows following: https://feedly.com/i/subscription/feed%2Fhttps%3A%2F%2Fwww.example.com%2F/rss/devops

When I click the Feedly link, my site shows up and allows me to follow it. The problem is that none of the news articles have links that will load on my website. If I turn on the "Open in website directly" and click a link, I get a Feedly 404 page.

Does anyone know what the problem is? Thanks!
4

0 回答 0