Link to images in RSS output #1

Closed
opened 2025-07-14 06:43:40 +00:00 by likho · 5 comments
Owner

Currently, a post with images renders as:

<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Your Microblog Title Here</title>
<link>https://yourdomain.tld/microblog/</link>
<description>Your description here.</description>
<lastBuildDate>Sat, 19 Mar 2022 04:16:55 -0700</lastBuildDate>
<item>
<title>Sample output. Images (not included with repository): 1.jpg, 2.jpg,</title>
<link>https://yourdomain.tld/microblog/#0</link>
<description>Sample output. Images (not included with repository): 1.jpg, 2.jpg, 3.jpg ...</description>
<pubDate>Sat, 19 Mar 2022 04:16:55 -0700</pubDate>
</item>
</channel>
</rss>

It should be:

<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Your Microblog Title Here</title>
<link>https://yourdomain.tld/microblog/</link>
<description>Your description here.</description>
<lastBuildDate>Sat, 19 Mar 2022 04:16:55 -0700</lastBuildDate>
<item>
<title>Sample output. Images (not included with repository): 1.jpg, 2.jpg,</title>
<link>https://yourdomain.tld/microblog/#0</link>
<description>Sample output. Images (not included with repository): &lt;a href="https://sub.domain.tld/1.jpg"&gt;https://sub.domain.tld/1.jpg&lt;/a&gt;
...

The file and affected function is here:
https://git.32bit.cafe/likho/microblog.py/src/branch/rss_1/src/rss.py#L39

Currently, a post with images renders as: <?xml version="1.0" encoding="utf-8"?> <rss version="2.0"> <channel> <title>Your Microblog Title Here</title> <link>https://yourdomain.tld/microblog/</link> <description>Your description here.</description> <lastBuildDate>Sat, 19 Mar 2022 04:16:55 -0700</lastBuildDate> <item> <title>Sample output. Images (not included with repository): 1.jpg, 2.jpg,</title> <link>https://yourdomain.tld/microblog/#0</link> <description>Sample output. Images (not included with repository): 1.jpg, 2.jpg, 3.jpg ...</description> <pubDate>Sat, 19 Mar 2022 04:16:55 -0700</pubDate> </item> </channel> </rss> It should be: <?xml version="1.0" encoding="utf-8"?> <rss version="2.0"> <channel> <title>Your Microblog Title Here</title> <link>https://yourdomain.tld/microblog/</link> <description>Your description here.</description> <lastBuildDate>Sat, 19 Mar 2022 04:16:55 -0700</lastBuildDate> <item> <title>Sample output. Images (not included with repository): 1.jpg, 2.jpg,</title> <link>https://yourdomain.tld/microblog/#0</link> <description>Sample output. Images (not included with repository): &lt;a href="https://sub.domain.tld/1.jpg"&gt;https://sub.domain.tld/1.jpg&lt;/a&gt; ... The file and affected function is here: https://git.32bit.cafe/likho/microblog.py/src/branch/rss_1/src/rss.py#L39
likho added reference rss_1 2025-07-14 06:43:47 +00:00
Contributor

I'm interested in contributing. What configuration in settings.toml should I use to get "https://sub.domain.tld/" ?

This is my public key: 8M5cnyAzRyxZYghZayTcedek2Lgk3HqAZPvtzXMWm6va:4LA

I'm interested in contributing. What configuration in settings.toml should I use to get "https://sub.domain.tld/" ? This is my public key: ```8M5cnyAzRyxZYghZayTcedek2Lgk3HqAZPvtzXMWm6va:4LA```
Author
Owner

Hi, @eloitor

The setting that would get you a domain name is rss.url. A subset of the config file is passed to the RSS function.

https://git.32bit.cafe/likho/microblog.py/src/branch/rss_1/src/rss.py#L39

Ah. I overlooked.
https://sub.domain.tld
https://yourdomain.tld
Should not indicate two different websites.
They should be the same website e.g what the microblog is generated for.

Basically, an image will render with <img> tags when generating the html page(s), but should render as links for someone to click on when using an RSS client.

Hi, @eloitor The setting that would get you a domain name is `rss.url`. A subset of the config file is passed to the RSS function. https://git.32bit.cafe/likho/microblog.py/src/branch/rss_1/src/rss.py#L39 Ah. I overlooked. `https://sub.domain.tld` `https://yourdomain.tld` Should not indicate two different websites. They should be the same website e.g what the microblog is generated for. Basically, an image will render with `<img>` tags when generating the html page(s), but should render as links for someone to click on when using an RSS client.
Contributor

use_atom = false

Why not generate rss and atom at the same time?

https://git.32bit.cafe/likho/microblog.py/src/commit/5044b2b0e9eab7e6d0e75ceff100fa825be19108/example/settings.toml#L82 Why not generate rss and atom at the same time?
Author
Owner

The files are named the same between RSS and Atom e.g feeds/tagname.xml.

Also generating two files for each tag is excessive.

The files are named the same between RSS and Atom e.g `feeds/tagname.xml`. Also generating two files for each tag is excessive.
Author
Owner

Done by pull request #4

Done by pull request #4
likho closed this issue 2025-09-06 20:26:46 +00:00
Sign in to join this conversation.
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: likho/microblog.py#1
No description provided.