say when there is no text in a footprint
This commit is contained in:
parent
8e9192ce98
commit
b1e3218eb3
@ -42,10 +42,17 @@ const ISO8601_DATE: u128 = iso8601::Config::DEFAULT
|
|||||||
|
|
||||||
impl Footprint {
|
impl Footprint {
|
||||||
pub fn into_rss_item(self, root_url: &str) -> Item {
|
pub fn into_rss_item(self, root_url: &str) -> Item {
|
||||||
|
let text = if String::is_empty(&self.text) {
|
||||||
|
"No description"
|
||||||
|
} else {
|
||||||
|
&self.text
|
||||||
|
};
|
||||||
|
// injection, I know
|
||||||
let desc = format!(
|
let desc = format!(
|
||||||
"{} <br /><br /> --- <br /><br /> from {}",
|
"{} <br /><br /> --- <br /><br /> from <a href=\"{}\">page {}</a>",
|
||||||
self.text,
|
text,
|
||||||
page_url(root_url, self.page)
|
page_url(root_url, self.page),
|
||||||
|
self.page
|
||||||
);
|
);
|
||||||
ItemBuilder::default()
|
ItemBuilder::default()
|
||||||
.title(Some(self.title))
|
.title(Some(self.title))
|
||||||
|
Loading…
Reference in New Issue
Block a user