about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEmile <hanemile@protonmail.com>2020-03-16 15:42:15 +0100
committerEmile <hanemile@protonmail.com>2020-03-16 15:42:15 +0100
commit8ef3d3618e9d2445ea10ad306589dcc989ac6f36 (patch)
tree2c99701f3c73079c5a522eb0fa78c1704b4bcb1b
parentf362b7894c59b9e434563afb33c1e0a1d97371e8 (diff)
site title
-rw-r--r--config.yml3
-rw-r--r--hosted/tmpl/index.html2
-rw-r--r--src/http/http.go5
3 files changed, 9 insertions, 1 deletions
diff --git a/config.yml b/config.yml
index 6c6780c..e8a6af8 100644
--- a/config.yml
+++ b/config.yml
@@ -14,6 +14,9 @@ server:
     listenport: "8085"
     root: "/"
 
+    # value to display as the site's title
+    name: "emile.space"
+
 time:
     # use the format below for describing the individual values
     # 
diff --git a/hosted/tmpl/index.html b/hosted/tmpl/index.html
index 4a17aee..ef66373 100644
--- a/hosted/tmpl/index.html
+++ b/hosted/tmpl/index.html
@@ -8,6 +8,8 @@
         <meta name="viewport" content="width=device-width, initial-scale=1.0">
 
         <link href="/assets/css/theme.css" rel="stylesheet">
+
+        <title>{{ .SiteTitle }}
     </head>
 
     <body onload='initFilter()'>
diff --git a/src/http/http.go b/src/http/http.go
index dd4fe95..49efdec 100644
--- a/src/http/http.go
+++ b/src/http/http.go
@@ -165,7 +165,10 @@ func pathHandler(w http.ResponseWriter, r *http.Request) {
 	content["Sort"] = "namedirfirst"
 	content["Order"] = "desc"
 
-	// if we're not at the root, we can still go futher down!
+	// Set the site's title to the title defined in the config
+	content["SiteTitle"] = viper.GetString("server.name")
+
+	// if we're not at the root, we can still go futher down
 	if r.RequestURI != "/" {
 		content["CanGoUp"] = "true"
 		logrus.Tracef("can go up")