commit e0f607218e8ed82c3b758b1fa90d5043d8dddaec
parent 893723795f3c620bb9e8cf183db776d0edb69a39
Author: Decay <decaydjk@tilde.town>
Date: Sat, 8 Feb 2020 19:32:23 +0000
Configurable blog title
Diffstat:
3 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/content.lisp b/src/content.lisp
@@ -7,6 +7,8 @@
:env (list
:title title
:posts entries
+ :year year
+ :month month
:archive-date-list archive-date-list
:content-formatter (miniblog.format:make-content-formatter)
:short-date-formatter (miniblog.format:make-short-date-formatter (or tz *default-timezone*))
diff --git a/src/miniblog.lisp b/src/miniblog.lisp
@@ -1,5 +1,6 @@
(in-package :miniblog)
+(defvar *blog-title* "Miniblog")
(defvar *blog-timezone* *default-timezone*)
(defvar *public-html*)
(defvar *root-uri*)
@@ -172,7 +173,7 @@
(defun miniblog (&key add get edit delete list start n regen-all help)
(init-tz)
(set-config-and-defaults)
- (make-generator)
+ (make-generator *blog-title*)
(miniblog.db:init :sqlite3 :database-name (get-db-filename))
(cond (add (add-new regen-all))
(get (get-post get))
diff --git a/src/template.lhtml b/src/template.lhtml
@@ -1,7 +1,12 @@
<!DOCTYPE html>
<html>
<head>
- <title><%= (or (getf env :title) "Miniblog") %></title>
+ <title>
+ <%= (or (getf env :title) "Miniblog") %>
+ <% @if year %>
+ - <% @var year %>/<% @var month %>
+ <% @endif %>
+ </title>
<style>
header#miniblog-header { width :100%; }
section#miniblog-left { float: left; width: 25%; }