From 9b35e43161c8467fc4e1f81b7e3bf2363614542a Mon Sep 17 00:00:00 2001 From: Albert S Date: Tue, 29 Mar 2022 22:37:45 +0200 Subject: [PATCH] dynamic: DynamicContentPostList: Link using UrlProvider::pageByTitle() --- dynamic/dynamiccontentpostlist.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dynamic/dynamiccontentpostlist.cpp b/dynamic/dynamiccontentpostlist.cpp index 9c3d439..02b7ea8 100644 --- a/dynamic/dynamiccontentpostlist.cpp +++ b/dynamic/dynamiccontentpostlist.cpp @@ -25,12 +25,13 @@ std::string DynamicContentPostList::render() stream << postListBegin; for(auto &pair : pageList) { - std::string link = this->urlProvider->page(pair.first); + std::string title = pageDao->find(pair.first)->title; + std::string link = this->urlProvider->pageByTitle(title); std::string date = utils::toISODate(pair.second); Varreplacer replacer{"{"}; replacer.addKeyValue("url", link); replacer.addKeyValue("date", date); - replacer.addKeyValue("title", pageDao->find(pair.first)->title); + replacer.addKeyValue("title", title); stream << replacer.parse(postLink); }