diff --git a/blog/sidebar.js b/blog/sidebar.js
index ac82c1a..55950fc 100644
--- a/blog/sidebar.js
+++ b/blog/sidebar.js
@@ -45,6 +45,26 @@ const getInformationForCategories = function(templateContext)
};
+const getInformationForPinnedPosts = function(templateContext)
+{
+ return new Promise(function(resolve, reject)
+ {
+ sql.getPinnedPosts().then(function(posts)
+ {
+ posts.forEach(function(p)
+ {
+ p.url = '/' + p.category + '/' + p.url;
+ });
+ templateContext.pinnedPosts = posts;
+ resolve();
+ }).catch(function(error)
+ {
+ reject(error);
+ })
+ });
+};
+
+
module.exports=
{
main: function(templateContext)
@@ -53,6 +73,7 @@ module.exports=
{
Promise.all([includes.fetchTemplate(TEMPLATE_FILE),
getInformationForRecentPosts(templateContext),
+ getInformationForPinnedPosts(templateContext),
getInformationForCategories(templateContext)])
.then(function(content)
{
diff --git a/docs/sqlConfig.md b/docs/sqlConfig.md
index cc438d6..867fdb2 100644
--- a/docs/sqlConfig.md
+++ b/docs/sqlConfig.md
@@ -29,9 +29,11 @@ picture_url varchar(100) not null,
published datetime not null,
name varchar(100) not null,
url varchar(100) not null,
+pinned BIT,
primary key(post_id)
);
+ALTER TABLE posts ADD pinned BIT;
create table downloads(
download_id mediumint unsigned not null AUTO_INCREMENT,
diff --git a/templates/blog/sideBar.html b/templates/blog/sideBar.html
index e79eb2f..7565656 100644
--- a/templates/blog/sideBar.html
+++ b/templates/blog/sideBar.html
@@ -34,3 +34,15 @@
+