diff --git a/blog/category.js b/blog/category.js
index 80fe24d..8a2e5ab 100644
--- a/blog/category.js
+++ b/blog/category.js
@@ -22,7 +22,7 @@ module.exports=
var page = request.query.page;
const category = requestURL.split("/").join("");
-
+ templateContext["title"] = category;
sql.getPostsFromCategory(category).then(function(posts)
{
Promise.all([blogBodyRenderer.renderBatchOfPosts(requestURL, posts, page, 5, templateContext),
diff --git a/blog/renderBlogPost.js b/blog/renderBlogPost.js
index 420d81f..46e90a6 100644
--- a/blog/renderBlogPost.js
+++ b/blog/renderBlogPost.js
@@ -178,7 +178,6 @@ module.exports=
},
-
pandocWrapper: function(markdownContents, pandocArgs)
{
return new Promise((resolve, reject)=>
@@ -208,7 +207,7 @@ module.exports=
/**
- * Renders a bunch of blog post previews to the user
+ * Renders a bunch of blog post previews to the user
*
* @param baseURL-- url of the page
* @param posts -- sql data about the blog to render
@@ -236,12 +235,12 @@ module.exports=
{
promises.push(new Promise(function(res, rej)
{
- if(posts.length != 1)
- {
- templateContext.preview = true
- }
module.exports.generateBlogPost(posts[i], posts.length === 1 ? -1: 3).then(function(tempContext)
{
+ if(posts.length != 1)
+ {
+ templateContext.preview = true
+ }
res(tempContext);
}).catch(function(error)
{
@@ -254,6 +253,10 @@ module.exports=
Promise.all(promises).then(function(posts)
{
templateContext.posts = posts;
+ if(posts.length == 1)
+ templateContext.title = posts[0].name;
+ else if(currentPage != 1 && baseURL === "/")
+ templateContext.title = "page " + currentPage;
resolve();
}).catch(function(error)
{
diff --git a/templates/blog/blogMain.html b/templates/blog/blogMain.html
index d5a4345..8657082 100644
--- a/templates/blog/blogMain.html
+++ b/templates/blog/blogMain.html
@@ -1,4 +1,4 @@
-{header}
+{>header}