2025-11-12 20:58:07 +01:00
|
|
|
/*
|
|
|
|
|
catcrafts.net
|
|
|
|
|
Copyright (C) 2025 Catcrafts
|
|
|
|
|
|
|
|
|
|
The source code of this website is made available for viewing purposes only.
|
|
|
|
|
No permission is granted to copy, modify, distribute, or create derivative works.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
export module Catcrafts:Blog_impl;
|
|
|
|
|
import :Blog;
|
|
|
|
|
import std;
|
|
|
|
|
|
|
|
|
|
namespace Catcrafts {
|
|
|
|
|
std::string RenderBlog() {
|
|
|
|
|
std::string html = "";
|
|
|
|
|
for(const BlogPost& post : *posts) {
|
2025-11-12 21:24:23 +01:00
|
|
|
html += std::format(R"(
|
|
|
|
|
<div class="post fade-in">
|
|
|
|
|
<div class="post-header">
|
|
|
|
|
<h2 class="post-title">{}</h2>
|
|
|
|
|
<span class="post-date">{}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="post-content">
|
|
|
|
|
{}
|
|
|
|
|
</div>
|
|
|
|
|
</div>)", post.name, post.date, post.content);
|
2025-11-12 20:58:07 +01:00
|
|
|
}
|
|
|
|
|
return html;
|
|
|
|
|
}
|
2025-11-12 21:24:23 +01:00
|
|
|
}
|