commit 82de8a25bb0d5a4a5e1813b3db80f4ed87d9f437
parent a67eeb0c9b0dab4803cb94da4c7803a1be04d219
Author: Joris Vink <joris@coders.se>
Date: Wed, 18 Apr 2018 21:42:08 +0200
add blog version html.
Diffstat:
3 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/assets/blog_version.html b/assets/blog_version.html
@@ -0,0 +1,3 @@
+<div class="blog-version">
+ <a target="_blank" href="https://github.com/jorisvink/kore-blog">%s</a>
+</div>
diff --git a/assets/style.css b/assets/style.css
@@ -14,6 +14,17 @@ body {
color: #fff;
}
+div.blog-version {
+ position: fixed;
+ left: 5px;
+ bottom: 5px;
+ font-size: 10px;
+}
+
+div.blog-version a {
+ text-decoration: none;
+}
+
h2.title {
margin-bottom: 15px;
font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
diff --git a/src/blog.c b/src/blog.c
@@ -30,6 +30,8 @@
#include "assets.h"
#define BLOG_DIR "blogs"
+#define BLOG_VER "kore-blog v0.1"
+
#define POST_FLAG_DRAFT 0x0001
struct post {
@@ -180,6 +182,9 @@ post_cache(struct post *post)
close(fd);
+ kore_buf_appendf(post->cache,
+ (const char *)asset_blog_version_html, BLOG_VER);
+
kore_buf_append(post->cache, asset_post_end_html,
asset_len_post_end_html);
}
@@ -296,6 +301,7 @@ list_posts(struct http_request *req, const char *type, int flags)
type, post->uri, post->title);
}
+ kore_buf_appendf(&buf, (const char *)asset_blog_version_html, BLOG_VER);
kore_buf_append(&buf, asset_index_end_html, asset_len_index_end_html);
http_response_header(req, "content-type", "text/html; charset=utf-8");