aboutsummaryrefslogtreecommitdiff
path: root/src/content/blog
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/blog')
-rw-r--r--src/content/blog/Blog.cpp9
-rw-r--r--src/content/blog/Blog.hpp4
2 files changed, 7 insertions, 6 deletions
diff --git a/src/content/blog/Blog.cpp b/src/content/blog/Blog.cpp
index ba8638e..47a3292 100644
--- a/src/content/blog/Blog.cpp
+++ b/src/content/blog/Blog.cpp
@@ -17,7 +17,8 @@ bool Blog::Init()
{
bool retval = true;
- std::cout << "Blog entries path: " << m_BlogPath << std::endl;
+ std::cout << "Blog entries filesystem path: " << m_BlogPath << std::endl;
+ std::cout << "Blog entries URI base path: " << m_UriBasePath << std::endl;
std::vector<std::string> extensions = {"json"};
Filesystem fs;
@@ -39,7 +40,7 @@ bool Blog::Init()
}
m_BlogEntriesSortedByDate.push_back(be);
- m_Redirections.push_back(std::filesystem::path(jfile.first).stem());
+ m_Redirections.push_back(m_UriBasePath + "/" + std::string(std::filesystem::path(jfile.first).stem()));
}
std::sort(m_BlogEntriesSortedByDate.begin(),
m_BlogEntriesSortedByDate.end(),
@@ -81,7 +82,7 @@ bool Blog::Render(RequestResponse & rr, RenderData & rd, std::string & out)
return true;
}
-std::string const & Blog::GetUriBasePath() const
+std::string & Blog::GetUriBasePath()
{
return m_UriBasePath;
}
@@ -91,7 +92,7 @@ std::string const & Blog::GetMainTemplate() const
return m_MainTemplatePath;
}
-Redirections const & Blog::GetRedirections() const
+Redirections & Blog::GetRedirections()
{
return m_Redirections;
}
diff --git a/src/content/blog/Blog.hpp b/src/content/blog/Blog.hpp
index d99185a..d58cd72 100644
--- a/src/content/blog/Blog.hpp
+++ b/src/content/blog/Blog.hpp
@@ -38,9 +38,9 @@ public:
void Shutdown();
bool Render(RequestResponse & rr, RenderData & rd, std::string & out);
- std::string const & GetUriBasePath() const;
+ std::string & GetUriBasePath();
std::string const & GetMainTemplate() const;
- Redirections const & GetRedirections() const;
+ Redirections & GetRedirections();
static bool ValidateAndSetMetdadata(BlogMetadata const & blogMetadata, BlogEntry & blogEntry);
bool ValidateEntries() const;