reverse breads order, new bread added
This commit is contained in:
+9
-3
@@ -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("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()
|
||||
.title("Piggo's Bread Gallery")
|
||||
@@ -126,6 +126,9 @@ fn main() {
|
||||
let mut channel_items = Vec::<Item>::new();
|
||||
|
||||
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 {
|
||||
let date = bread.date.format("%Y/%m/%d").to_string();
|
||||
@@ -174,7 +177,7 @@ fn main() {
|
||||
.replace("{img_alt}", &img_alt)
|
||||
.replace("{title}", &date);
|
||||
|
||||
thumbs.push_str(&thumb);
|
||||
thumbs.push(thumb);
|
||||
}
|
||||
|
||||
// Add to RSS
|
||||
@@ -220,8 +223,11 @@ fn main() {
|
||||
hashes.save();
|
||||
|
||||
{
|
||||
// make thumbs go from the newest to the oldest
|
||||
thumbs.reverse();
|
||||
|
||||
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());
|
||||
|
||||
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>
|
||||
<pubDate>Mon, 28 Jan 2019 12:00:00 +0000</pubDate>
|
||||
</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’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".</p>
|
||||
|
||||
<p>also forgot to score it, oops</p>
|
||||
|
||||
<p>Gonna be more careful next time. It’ll taste better when it cools down, I’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>
|
||||
</rss>
|
||||
Reference in New Issue
Block a user