Minor fixes to navigator <a> tags

This commit is contained in:
Rosia E Evans 2023-09-28 13:33:34 +01:00
parent 202801841d
commit 33cc777a65
3 changed files with 9 additions and 3 deletions

View file

@ -71,7 +71,7 @@ std::string BlogPageBuilder::generateNavSection()
if (page->getPageFlags().hidden)
continue;
buffer
<< "<li><a href=" << page->getOutFileUrl() << ">"
<< "<li><a href=" << page->getRelativeUrl() << ">"
<< page->getPageTitle()
<< "</a></li>\n";
}

View file

@ -30,8 +30,7 @@ Page::Page(std::string sourceFileUrl, std::string outFolderUrl)
calculatePageFlags();
calculatePageTitle();
std::string formattedTitle = findAndReplace(title, " ", "_");
this->outFileUrl = outFolderUrl + "/" + formattedTitle + ".html";
this->outFileUrl = outFolderUrl + getRelativeUrl();
}
std::string Page::getSourceFileContents()
@ -44,6 +43,12 @@ std::string Page::getOutFileUrl()
return outFileUrl;
}
std::string Page::getRelativeUrl()
{
std::string formattedTitle = findAndReplace(title, " ", "_");
return "/" + formattedTitle + ".html";
}
FileFlags Page::getPageFlags()
{
return flags;

View file

@ -44,6 +44,7 @@ public:
std::string getSourceFileContents();
std::string getOutFileUrl();
std::string getRelativeUrl();
std::string getPageTitle();
FileFlags getPageFlags();