rss-exclusive notes, improvements, 2019-02-02 bread added

master
Ondřej Hruška 5 years ago
parent 03a34e0e09
commit f876c590f3
Signed by: MightyPork
GPG Key ID: 2C5FD5035250423D
  1. 24
      src/main.rs
  2. BIN
      web/data/2019-01-28/2019-01-28 16.21.27 cover.jpg
  3. BIN
      web/data/2019-02-02/2019-02-02 20.54.28.jpg
  4. 1
      web/data/2019-02-02/note.txt
  5. 3
      web/data/2019-02-02/rss.txt
  6. 57
      web/feed.xml

@ -27,6 +27,7 @@ struct Bread {
rel_path: PathBuf,
date: chrono::NaiveDate,
note: String,
rss_note: String,
images: Vec<PathBuf>,
}
@ -50,13 +51,19 @@ impl Bread {
fn parse(base_dir : &PathBuf, bread_dir : &DirEntry) -> Result<Bread, std::io::Error> {
let bpath = bread_dir.path();
let mut note = String::new();
let mut rss_note = String::new();
let mut note_path = bpath.join("note.txt");
let mut rss_note_path = bpath.join("rss.txt");
// try a md one as a fallback
if !note_path.exists() {
note_path = bpath.join("note.md");
}
if !rss_note_path.exists() {
rss_note_path = bpath.join("rss.md");
}
if note_path.exists() {
let mut note_file = File::open(note_path)?;
@ -64,6 +71,12 @@ impl Bread {
note = markdown::to_html(&note);
}
if rss_note_path.exists() {
let mut note_file = File::open(rss_note_path)?;
note_file.read_to_string(&mut rss_note)?;
rss_note = markdown::to_html(&rss_note);
}
let mut bread_files: Vec<DirEntry> = fs::read_dir(&bpath)?.map(|e| e.unwrap()).collect();
bread_files.sort_by(|x, y| x.file_name().cmp(&y.file_name()));
@ -82,6 +95,7 @@ impl Bread {
rel_path: bpath.strip_prefix(base_dir).unwrap().to_path_buf(),
path: bpath,
note,
rss_note,
images
});
}
@ -139,6 +153,7 @@ fn main() {
let (img_path, img_alt) = bread.thumb_photo();
let note = if bread.note.is_empty() { "<i>There's no note about this bread.</i>" } else { &bread.note };
let rss_note = &bread.rss_note;
let thumb_fname = date_slug.clone() + "." + Path::new(&img_path).extension().unwrap().to_str().unwrap();
let thumb_path = thumbs_path.join(&thumb_fname);
@ -191,11 +206,18 @@ fn main() {
let date_formatted : Date<Utc> = chrono::Utc.from_local_date(&bread.date).unwrap();
let dt = date_formatted.and_hms(12,0,0);
let mut descr = String::new();
if !rss_note.is_empty() {
descr.push_str(&(rss_note.to_string() + "<hr>"));
}
descr.push_str(note);
descr.push_str(&format!("<img src=\"{}\" alt=\"{}\"><p><i>Open the link for full-res photos ({} total)</i>", image_url, img_alt, bread.images.len()));
channel_items.push(ItemBuilder::default()
.title(date.clone())
.link(link.clone())
.description(note.to_string() + &format!("<img src=\"{}\" alt=\"{}\"><p>Open the link for more...</p>", image_url, img_alt))
.description(descr)
.guid(guid)
.pub_date(dt.to_rfc2822())
.build().unwrap());

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 MiB

After

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

@ -0,0 +1 @@
Scoring came out great this time.

@ -0,0 +1,3 @@
**time flies, huh? there's a new bread already!**
*New:* The bread gallery is now sorted from the newest bread. Check it out!

@ -10,7 +10,7 @@
<![CDATA[<p>This was my first bread ever.</p>
<p>I didn&#8217;t have a sourdough starter yet, so it used store-bought yeast. It looked okay, tasted mediocre.</p>
<img src="https://www.ondrovo.com/bread/thumbs/2018-09-19.jpg" alt="dgs - 2 sep 19 cover.jpg"><p>Open the link for more...</p>]]>
<img src="https://www.ondrovo.com/bread/thumbs/2018-09-19.jpg" alt="dgs - 2 sep 19 cover.jpg"><p><i>Open the link for full-res photos (2 total)</i>]]>
</description>
<guid>https://www.ondrovo.com/bread/2018-09-19.html</guid>
<pubDate>Wed, 19 Sep 2018 12:00:00 +0000</pubDate>
@ -20,7 +20,7 @@
<link>https://www.ondrovo.com/bread/2018-09-26.html</link>
<description>
<![CDATA[<p>My first sourdough bread. I added coriander seeds to it. Pretty good</p>
<img src="https://www.ondrovo.com/bread/thumbs/2018-09-26.jpg" alt="dgs - 3 sep 26.jpg"><p>Open the link for more...</p>]]>
<img src="https://www.ondrovo.com/bread/thumbs/2018-09-26.jpg" alt="dgs - 3 sep 26.jpg"><p><i>Open the link for full-res photos (2 total)</i>]]>
</description>
<guid>https://www.ondrovo.com/bread/2018-09-26.html</guid>
<pubDate>Wed, 26 Sep 2018 12:00:00 +0000</pubDate>
@ -30,7 +30,7 @@
<link>https://www.ondrovo.com/bread/2018-09-30.html</link>
<description>
<![CDATA[<p>nice crust, but it had huge holes in it. idk why</p>
<img src="https://www.ondrovo.com/bread/thumbs/2018-09-30.jpg" alt="dgs - 7 sep 30 cover.jpg"><p>Open the link for more...</p>]]>
<img src="https://www.ondrovo.com/bread/thumbs/2018-09-30.jpg" alt="dgs - 7 sep 30 cover.jpg"><p><i>Open the link for full-res photos (4 total)</i>]]>
</description>
<guid>https://www.ondrovo.com/bread/2018-09-30.html</guid>
<pubDate>Sun, 30 Sep 2018 12:00:00 +0000</pubDate>
@ -40,7 +40,7 @@
<link>https://www.ondrovo.com/bread/2018-10-04.html</link>
<description>
<![CDATA[<p>Tried cutting the dough blob before baking, like I saw in some tutorial. I think I overdid it a bit</p>
<img src="https://www.ondrovo.com/bread/thumbs/2018-10-04.jpg" alt="dgs - 9 oct 4.jpg"><p>Open the link for more...</p>]]>
<img src="https://www.ondrovo.com/bread/thumbs/2018-10-04.jpg" alt="dgs - 9 oct 4.jpg"><p><i>Open the link for full-res photos (1 total)</i>]]>
</description>
<guid>https://www.ondrovo.com/bread/2018-10-04.html</guid>
<pubDate>Thu, 4 Oct 2018 12:00:00 +0000</pubDate>
@ -50,7 +50,7 @@
<link>https://www.ondrovo.com/bread/2018-10-09.html</link>
<description>
<![CDATA[<p>a bit flat, but tasty</p>
<img src="https://www.ondrovo.com/bread/thumbs/2018-10-09.jpg" alt="dgs - 10 oct 9.jpg"><p>Open the link for more...</p>]]>
<img src="https://www.ondrovo.com/bread/thumbs/2018-10-09.jpg" alt="dgs - 10 oct 9.jpg"><p><i>Open the link for full-res photos (2 total)</i>]]>
</description>
<guid>https://www.ondrovo.com/bread/2018-10-09.html</guid>
<pubDate>Tue, 9 Oct 2018 12:00:00 +0000</pubDate>
@ -60,7 +60,7 @@
<link>https://www.ondrovo.com/bread/2018-10-15.html</link>
<description>
<![CDATA[<p>nice crust</p>
<img src="https://www.ondrovo.com/bread/thumbs/2018-10-15.jpg" alt="dgs - 12 oct 15.jpg"><p>Open the link for more...</p>]]>
<img src="https://www.ondrovo.com/bread/thumbs/2018-10-15.jpg" alt="dgs - 12 oct 15.jpg"><p><i>Open the link for full-res photos (1 total)</i>]]>
</description>
<guid>https://www.ondrovo.com/bread/2018-10-15.html</guid>
<pubDate>Mon, 15 Oct 2018 12:00:00 +0000</pubDate>
@ -70,7 +70,7 @@
<link>https://www.ondrovo.com/bread/2018-10-20.html</link>
<description>
<![CDATA[<p>I made the dough too runny–too much water–so it spilled over the whole baking form. That&#8217;s why it&#8217;s round. I dont remember what it tasted like, probably average</p>
<img src="https://www.ondrovo.com/bread/thumbs/2018-10-20.jpg" alt="dgs - 13 oct 20.jpg"><p>Open the link for more...</p>]]>
<img src="https://www.ondrovo.com/bread/thumbs/2018-10-20.jpg" alt="dgs - 13 oct 20.jpg"><p><i>Open the link for full-res photos (1 total)</i>]]>
</description>
<guid>https://www.ondrovo.com/bread/2018-10-20.html</guid>
<pubDate>Sat, 20 Oct 2018 12:00:00 +0000</pubDate>
@ -79,7 +79,7 @@
<title>2018/10/24</title>
<link>https://www.ondrovo.com/bread/2018-10-24.html</link>
<description>
<![CDATA[<i>There's no note about this bread.</i><img src="https://www.ondrovo.com/bread/thumbs/2018-10-24.jpg" alt="dgs - 14 oct 24.jpg"><p>Open the link for more...</p>]]>
<![CDATA[<i>There's no note about this bread.</i><img src="https://www.ondrovo.com/bread/thumbs/2018-10-24.jpg" alt="dgs - 14 oct 24.jpg"><p><i>Open the link for full-res photos (1 total)</i>]]>
</description>
<guid>https://www.ondrovo.com/bread/2018-10-24.html</guid>
<pubDate>Wed, 24 Oct 2018 12:00:00 +0000</pubDate>
@ -89,7 +89,7 @@
<link>https://www.ondrovo.com/bread/2018-10-30.html</link>
<description>
<![CDATA[<p>this came out a bit more &quot;rustic&quot; than usual. the cracked crust looks nice, but it makes slicing difficult</p>
<img src="https://www.ondrovo.com/bread/thumbs/2018-10-30.jpg" alt="dgs - 15 oct 30.jpg"><p>Open the link for more...</p>]]>
<img src="https://www.ondrovo.com/bread/thumbs/2018-10-30.jpg" alt="dgs - 15 oct 30.jpg"><p><i>Open the link for full-res photos (2 total)</i>]]>
</description>
<guid>https://www.ondrovo.com/bread/2018-10-30.html</guid>
<pubDate>Tue, 30 Oct 2018 12:00:00 +0000</pubDate>
@ -99,7 +99,7 @@
<link>https://www.ondrovo.com/bread/2018-11-06.html</link>
<description>
<![CDATA[<p>Experimenting with chia seeds. Tasted okay, but a lot of the seeds didn&#8217;t stick to the bread. Maybe I should&#8217;ve put them in water for a bit first.. they get all slimy in water, might stick better</p>
<img src="https://www.ondrovo.com/bread/thumbs/2018-11-06.jpg" alt="dgs - 17 nov 6.jpg"><p>Open the link for more...</p>]]>
<img src="https://www.ondrovo.com/bread/thumbs/2018-11-06.jpg" alt="dgs - 17 nov 6.jpg"><p><i>Open the link for full-res photos (1 total)</i>]]>
</description>
<guid>https://www.ondrovo.com/bread/2018-11-06.html</guid>
<pubDate>Tue, 6 Nov 2018 12:00:00 +0000</pubDate>
@ -109,7 +109,7 @@
<link>https://www.ondrovo.com/bread/2018-11-20.html</link>
<description>
<![CDATA[<p>cracked crust again</p>
<img src="https://www.ondrovo.com/bread/thumbs/2018-11-20.jpg" alt="dgs - 18 - nov 20.jpg"><p>Open the link for more...</p>]]>
<img src="https://www.ondrovo.com/bread/thumbs/2018-11-20.jpg" alt="dgs - 18 - nov 20.jpg"><p><i>Open the link for full-res photos (1 total)</i>]]>
</description>
<guid>https://www.ondrovo.com/bread/2018-11-20.html</guid>
<pubDate>Tue, 20 Nov 2018 12:00:00 +0000</pubDate>
@ -121,7 +121,7 @@
<![CDATA[<p>I didn&#8217;t bake any bread for almost a month and the starter culture went bad. This bread didn&#8217;t rise at all and was super sour.</p>
<p>Was planning to eat it, but it was just disgusting. I threw the whole thing out and refreshed the starter for about a week.</p>
<img src="https://www.ondrovo.com/bread/thumbs/2018-12-28.jpg" alt="pleroma - 2018-12-28.jpg"><p>Open the link for more...</p>]]>
<img src="https://www.ondrovo.com/bread/thumbs/2018-12-28.jpg" alt="pleroma - 2018-12-28.jpg"><p><i>Open the link for full-res photos (1 total)</i>]]>
</description>
<guid>https://www.ondrovo.com/bread/2018-12-28.html</guid>
<pubDate>Fri, 28 Dec 2018 12:00:00 +0000</pubDate>
@ -131,7 +131,7 @@
<link>https://www.ondrovo.com/bread/2019-01-02.html</link>
<description>
<![CDATA[<p>First bread with the renewed starter culture. Didn&#8217;t rise much, but tasted okay.</p>
<img src="https://www.ondrovo.com/bread/thumbs/2019-01-02.jpg" alt="pleroma - 2019-01-02.jpg"><p>Open the link for more...</p>]]>
<img src="https://www.ondrovo.com/bread/thumbs/2019-01-02.jpg" alt="pleroma - 2019-01-02.jpg"><p><i>Open the link for full-res photos (1 total)</i>]]>
</description>
<guid>https://www.ondrovo.com/bread/2019-01-02.html</guid>
<pubDate>Wed, 2 Jan 2019 12:00:00 +0000</pubDate>
@ -141,7 +141,7 @@
<link>https://www.ondrovo.com/bread/2019-01-06.html</link>
<description>
<![CDATA[<p>that&#8217;s more like it</p>
<img src="https://www.ondrovo.com/bread/thumbs/2019-01-06.jpg" alt="pleroma - 2019-01-06.jpg"><p>Open the link for more...</p>]]>
<img src="https://www.ondrovo.com/bread/thumbs/2019-01-06.jpg" alt="pleroma - 2019-01-06.jpg"><p><i>Open the link for full-res photos (1 total)</i>]]>
</description>
<guid>https://www.ondrovo.com/bread/2019-01-06.html</guid>
<pubDate>Sun, 6 Jan 2019 12:00:00 +0000</pubDate>
@ -151,7 +151,7 @@
<link>https://www.ondrovo.com/bread/2019-01-08.html</link>
<description>
<![CDATA[<p>trying a new recipe - I may have finally found the right ratio of rye vs wheat flour. It&#8217;s quite simple - 1:1. Baked with 200g of each and one spoon of salt. Note the starter is rye only, so it counts into the rye amount.</p>
<img src="https://www.ondrovo.com/bread/thumbs/2019-01-08.jpg" alt="pleroma - 2019-01-09 cover.jpg"><p>Open the link for more...</p>]]>
<img src="https://www.ondrovo.com/bread/thumbs/2019-01-08.jpg" alt="pleroma - 2019-01-09 cover.jpg"><p><i>Open the link for full-res photos (2 total)</i>]]>
</description>
<guid>https://www.ondrovo.com/bread/2019-01-08.html</guid>
<pubDate>Tue, 8 Jan 2019 12:00:00 +0000</pubDate>
@ -179,7 +179,7 @@
<li>5g of <em>instant</em> yeast (bought in a bunch of small bags)</li>
</ul>
<img src="https://www.ondrovo.com/bread/thumbs/2019-01-10.jpg" alt="pleroma - 2019-01-10 a.jpg"><p>Open the link for more...</p>]]>
<img src="https://www.ondrovo.com/bread/thumbs/2019-01-10.jpg" alt="pleroma - 2019-01-10 a.jpg"><p><i>Open the link for full-res photos (2 total)</i>]]>
</description>
<guid>https://www.ondrovo.com/bread/2019-01-10.html</guid>
<pubDate>Thu, 10 Jan 2019 12:00:00 +0000</pubDate>
@ -189,7 +189,7 @@
<link>https://www.ondrovo.com/bread/2019-01-11.html</link>
<description>
<![CDATA[<p>this one was very good</p>
<img src="https://www.ondrovo.com/bread/thumbs/2019-01-11.jpg" alt="pleroma - 2019-01-11 b cover.jpg"><p>Open the link for more...</p>]]>
<img src="https://www.ondrovo.com/bread/thumbs/2019-01-11.jpg" alt="pleroma - 2019-01-11 b cover.jpg"><p><i>Open the link for full-res photos (2 total)</i>]]>
</description>
<guid>https://www.ondrovo.com/bread/2019-01-11.html</guid>
<pubDate>Fri, 11 Jan 2019 12:00:00 +0000</pubDate>
@ -199,7 +199,7 @@
<link>https://www.ondrovo.com/bread/2019-01-14.html</link>
<description>
<![CDATA[<p>nice texture, not cracked at all. this is because I added some water into the baking form, so it made steam. like you&#8217;re supposed to.</p>
<img src="https://www.ondrovo.com/bread/thumbs/2019-01-14.jpg" alt="pleroma - 2019-01-14.jpg"><p>Open the link for more...</p>]]>
<img src="https://www.ondrovo.com/bread/thumbs/2019-01-14.jpg" alt="pleroma - 2019-01-14.jpg"><p><i>Open the link for full-res photos (1 total)</i>]]>
</description>
<guid>https://www.ondrovo.com/bread/2019-01-14.html</guid>
<pubDate>Mon, 14 Jan 2019 12:00:00 +0000</pubDate>
@ -211,7 +211,7 @@
<![CDATA[<p>made the dough too dry, so it couldn&#8217;t rise properly. also didn&#8217;t do the steam thing. all in all a disaster</p>
<p>but it tasted okay regardless</p>
<img src="https://www.ondrovo.com/bread/thumbs/2019-01-19.jpg" alt="pleroma - 2019-01-19 a.jpg"><p>Open the link for more...</p>]]>
<img src="https://www.ondrovo.com/bread/thumbs/2019-01-19.jpg" alt="pleroma - 2019-01-19 a.jpg"><p><i>Open the link for full-res photos (2 total)</i>]]>
</description>
<guid>https://www.ondrovo.com/bread/2019-01-19.html</guid>
<pubDate>Sat, 19 Jan 2019 12:00:00 +0000</pubDate>
@ -225,7 +225,7 @@
<p>The starter with rye was sitting in its bowl overnight, then I mixed it with wheat, salt and spices in the morning and let it do its work til about 2 PM. The dough was nice and stringy, as you can see in the pictures.</p>
<p>Also the crust came out excellent, not too thick and crunchy.</p>
<img src="https://www.ondrovo.com/bread/thumbs/2019-01-23.jpg" alt="2019-01-23 19.42.04 cover.jpg"><p>Open the link for more...</p>]]>
<img src="https://www.ondrovo.com/bread/thumbs/2019-01-23.jpg" alt="2019-01-23 19.42.04 cover.jpg"><p><i>Open the link for full-res photos (3 total)</i>]]>
</description>
<guid>https://www.ondrovo.com/bread/2019-01-23.html</guid>
<pubDate>Wed, 23 Jan 2019 12:00:00 +0000</pubDate>
@ -241,7 +241,7 @@
<p>I also don&#8217;t normally score the bread, after the <a href='2018-10-04.html'>last experiment</a> failed so spectacularly. This was still too deep, but it turned out a lot better.</p>
<p>And it tastes pretty damn good!</p>
<img src="https://www.ondrovo.com/bread/thumbs/2019-01-28.jpg" alt="2019-01-28 16.21.27 cover.jpg"><p>Open the link for more...</p>]]>
<img src="https://www.ondrovo.com/bread/thumbs/2019-01-28.jpg" alt="2019-01-28 16.21.27 cover.jpg"><p><i>Open the link for full-res photos (4 total)</i>]]>
</description>
<guid>https://www.ondrovo.com/bread/2019-01-28.html</guid>
<pubDate>Mon, 28 Jan 2019 12:00:00 +0000</pubDate>
@ -261,10 +261,23 @@
<p>Gonna be more careful next time. It&#8217;ll taste better when it cools down, I&#8217;m sure</p>
<p><em>update: it tastes fine after a few hours!</em></p>
<img src="https://www.ondrovo.com/bread/thumbs/2019-01-31.jpg" alt="2019-01-31 10.58.43 cover.jpg"><p>Open the link for more...</p>]]>
<img src="https://www.ondrovo.com/bread/thumbs/2019-01-31.jpg" alt="2019-01-31 10.58.43 cover.jpg"><p><i>Open the link for full-res photos (4 total)</i>]]>
</description>
<guid>https://www.ondrovo.com/bread/2019-01-31.html</guid>
<pubDate>Thu, 31 Jan 2019 12:00:00 +0000</pubDate>
</item>
<item>
<title>2019/02/02</title>
<link>https://www.ondrovo.com/bread/2019-02-02.html</link>
<description>
<![CDATA[<p><strong>time flies, huh? there&#8217;s a new bread already!</strong></p>
<p><em>New:</em> The bread gallery is now sorted from the newest bread. Check it out!</p>
<hr><p>Scoring came out great this time.</p>
<img src="https://www.ondrovo.com/bread/thumbs/2019-02-02.jpg" alt="2019-02-02 20.54.28.jpg"><p><i>Open the link for full-res photos (1 total)</i>]]>
</description>
<guid>https://www.ondrovo.com/bread/2019-02-02.html</guid>
<pubDate>Sat, 2 Feb 2019 12:00:00 +0000</pubDate>
</item>
</channel>
</rss>
Loading…
Cancel
Save