stamd

Static Markdown Page Generator
git clone git://git.dimitrijedobrota.com/stamd.git
Log | Files | Refs | README | LICENSE

commit f665400eb79cc3a3d141b757226852153d07b9b7
parent a7be31f8837bfec10c50673049a8f477dfd14542
Author: Dimitrije Dobrota <mail@dimitrijedobrota.com>
Date:   Wed,  1 Jan 2025 21:00:24 +0100

Fix creation of category index

Diffstat:
MCMakeLists.txt | 2+-
Msource/indexer.cpp | 3+--
Msource/main.cpp | 2+-
3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt @@ -4,7 +4,7 @@ include(cmake/prelude.cmake) project( stamd - VERSION 0.2.8 + VERSION 0.2.9 DESCRIPTION "Static Markdown Page Generator" HOMEPAGE_URL "https://git.dimitrijedobrota.com/stamd.git" LANGUAGES CXX diff --git a/source/indexer.cpp b/source/indexer.cpp @@ -89,6 +89,7 @@ void indexer::create_index(std::ostream& ost, for (const auto& article : m_articles) { if (article->is_hidden()) continue; + if (name != "blog" && !article->get_categories().count(name)) continue; const auto& filename = article->get_filename(); const auto& title = article->get_title(); @@ -100,8 +101,6 @@ void indexer::create_index(std::ostream& ost, }; ost << html::ul(); index->write_footer(ost); - - add(index); } void indexer::create_atom(std::ostream& ost, const std::string& name) const diff --git a/source/main.cpp b/source/main.cpp @@ -178,7 +178,7 @@ int main(int argc, char* argv[]) indexer.create_atom(atom, "index"); std::ofstream index(args.output_dir / "index.html"); - indexer.create_index(index, "blog index", categories); + indexer.create_index(index, "blog", categories); for (const auto& [category, articles] : category_map) {