reverse breads order, new bread added

master
Ondřej Hruška 6 years ago
parent 3b7b8cf13f
commit 03a34e0e09
Signed by: MightyPork
GPG Key ID: 2C5FD5035250423D
  1. 12
      src/main.rs
  2. BIN
      web/data/2019-01-31/2019-01-31 09.50.29.jpg
  3. BIN
      web/data/2019-01-31/2019-01-31 09.51.46.jpg
  4. BIN
      web/data/2019-01-31/2019-01-31 10.58.43 cover.jpg
  5. BIN
      web/data/2019-01-31/2019-01-31 11.13.07.jpg
  6. 12
      web/data/2019-01-31/note.txt
  7. 20
      web/feed.xml

@ -114,7 +114,7 @@ fn main() {
File::open(tpl_path.join("_head.html")).unwrap().read_to_string(&mut head_tpl).unwrap(); File::open(tpl_path.join("_head.html")).unwrap().read_to_string(&mut head_tpl).unwrap();
File::open(tpl_path.join("detail.html")).unwrap().read_to_string(&mut detail_tpl).unwrap(); File::open(tpl_path.join("detail.html")).unwrap().read_to_string(&mut detail_tpl).unwrap();
let mut thumbs = String::new(); let mut thumbs = Vec::<String>::new();
let mut channel : Channel = ChannelBuilder::default() let mut channel : Channel = ChannelBuilder::default()
.title("Piggo's Bread Gallery") .title("Piggo's Bread Gallery")
@ -126,6 +126,9 @@ fn main() {
let mut channel_items = Vec::<Item>::new(); let mut channel_items = Vec::<Item>::new();
let mut hashes = hash_dict::HashDict::load(cwd.join(".hashes.txt")).unwrap(); let mut hashes = hash_dict::HashDict::load(cwd.join(".hashes.txt")).unwrap();
// TODO separate thumbs by year and generate per-year pages
// TODO limit RSS to last N breads
for bread in &breads { for bread in &breads {
let date = bread.date.format("%Y/%m/%d").to_string(); let date = bread.date.format("%Y/%m/%d").to_string();
@ -174,7 +177,7 @@ fn main() {
.replace("{img_alt}", &img_alt) .replace("{img_alt}", &img_alt)
.replace("{title}", &date); .replace("{title}", &date);
thumbs.push_str(&thumb); thumbs.push(thumb);
} }
// Add to RSS // Add to RSS
@ -220,8 +223,11 @@ fn main() {
hashes.save(); hashes.save();
{ {
// make thumbs go from the newest to the oldest
thumbs.reverse();
println!("Building the gallery page"); println!("Building the gallery page");
let main = main_tpl.replace("{breads}", &thumbs.trim()) let main = main_tpl.replace("{breads}", &thumbs.join("").trim())
.replace("{head}", &head_tpl.replace("{title}", "Piggo's breads").trim()); .replace("{head}", &head_tpl.replace("{title}", "Piggo's breads").trim());
let mut f = OpenOptions::new().write(true).truncate(true).create(true).open(web_path.join("index.html")).unwrap(); let mut f = OpenOptions::new().write(true).truncate(true).create(true).open(web_path.join("index.html")).unwrap();

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 MiB

@ -0,0 +1,12 @@
Testing my new rattan basket. It was time for an upgrade ^_^
Shape is ok, but the bread came out tasting a little sour. sourdough duh
But it's because of poor planning, I started it too late in the day so
it wasn't ready by the time I went to bed, and in the morning it was "over-proofed".
also forgot to score it, oops
Gonna be more careful next time. It'll taste better when it cools down, I'm sure
*update: it tastes fine after a few hours!*

@ -246,5 +246,25 @@
<guid>https://www.ondrovo.com/bread/2019-01-28.html</guid> <guid>https://www.ondrovo.com/bread/2019-01-28.html</guid>
<pubDate>Mon, 28 Jan 2019 12:00:00 +0000</pubDate> <pubDate>Mon, 28 Jan 2019 12:00:00 +0000</pubDate>
</item> </item>
<item>
<title>2019/01/31</title>
<link>https://www.ondrovo.com/bread/2019-01-31.html</link>
<description>
<![CDATA[<p>Testing my new rattan basket. It was time for an upgrade ^_^</p>
<p>Shape is ok, but the bread came out tasting a little sour. sourdough duh</p>
<p>But it&#8217;s because of poor planning, I started it too late in the day so it wasn&#8217;t ready by the time I went to bed, and in the morning it was &quot;over-proofed&quot;.</p>
<p>also forgot to score it, oops</p>
<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>]]>
</description>
<guid>https://www.ondrovo.com/bread/2019-01-31.html</guid>
<pubDate>Thu, 31 Jan 2019 12:00:00 +0000</pubDate>
</item>
</channel> </channel>
</rss> </rss>
Loading…
Cancel
Save