namespace stamd {
void create_index(const std::string& name,
void create_index(std::ostream& ost,
const std::string& name,
const article_list& articles,
const categories_t& categories)
{
using namespace hemplate; // NOLINT
std::ofstream ost(name + ".html");
std::stringstream strs;
const article index(name, categories);
strs << html::h1(name);
strs << html::ul().set("class", "index");
index.write_header(ost);
ost << html::h1(name);
ost << html::ul().set("class", "index");
for (const auto& article : articles)
{
if (article->is_hidden()) continue;
const auto& filename = article->get_filename();
const auto& title = article->get_title();
const auto& title = article->get_title();
const auto& date = article->get_date();
strs << html::li()
.add(html::div(std::format("{} - ", date)))
.add(html::div().add(html::a(title).set("href", filename)));
ost << html::li()
.add(html::span(std::format("{} - ", date)))
.add(html::a(title).set("href", filename));
};
strs << html::ul();
article index(name, categories);
index.write(strs.str(), ost);
ost << html::ul();
index.write_footer(ost);
}
void create_atom(std::ostream& ost,