Repos / s4g / 3eb6ced7ab
commit 3eb6ced7ab2ec928b3f41c6addcbe0f30aa5c049
Author: Nhân <hi@imnhan.com>
Date: Tue Jul 4 11:33:51 2023 +0700
add footer
diff --git a/main.go b/main.go
index 4f8678b..99596a2 100644
--- a/main.go
+++ b/main.go
@@ -63,11 +63,12 @@ func main() {
}
type SiteMetadata struct {
- Address string
- Name string
- Tagline string
- HomePath string
- Author struct {
+ Address string
+ Name string
+ Tagline string
+ HomePath string
+ DisableFooter bool
+ Author struct {
Name string
URI string
Email string
@@ -120,6 +121,7 @@ func (a *Article) WriteHtmlFile(site *SiteMetadata, pages []Article) {
Post *Article
Pages []Article
Feed string
+ Now time.Time
}{
Site: site,
Content: template.HTML(contentHtml),
@@ -127,6 +129,7 @@ func (a *Article) WriteHtmlFile(site *SiteMetadata, pages []Article) {
Post: a,
Pages: pages,
Feed: site.HomePath + FEED_PATH,
+ Now: time.Now(),
})
if err != nil {
fmt.Println("Error in WriteHtmlFile:", err)
@@ -156,12 +159,14 @@ func WriteHomePage(fsys WritableFS, site SiteMetadata, posts, pages []Article) {
Posts []Article
Pages []Article
Feed string
+ Now time.Time
}{
Site: &site,
Title: fmt.Sprintf("%s - %s", site.Name, site.Tagline),
Posts: posts,
Pages: pages,
Feed: site.HomePath + FEED_PATH,
+ Now: time.Now(),
})
if err != nil {
fmt.Println("Error in WriteHtmlFile:", err)
diff --git a/www/_theme/base.tmpl b/www/_theme/base.tmpl
index 243c903..499adcc 100644
--- a/www/_theme/base.tmpl
+++ b/www/_theme/base.tmpl
@@ -1,5 +1,5 @@
<!DOCTYPE html>
-<html lang="en">
+<html>
<head>
<meta charset="utf-8" />
@@ -17,6 +17,21 @@
<body>
{{template "body" .}}
+
+{{if not .Site.DisableFooter}}
+<footer>
+Copyright {{.Now.Year}} {{.Site.Author.Name}}. All rights reserved.<br>
+Made with <a href="https://github.com/nhanb/webmaker2000">WebMaker2000</a>.
+</footer>
+<style>
+footer {
+ margin-top: 2rem;
+ text-align: right;
+ font-size: 0.8rem;
+}
+</style>
+{{end}}
+
</body>
</html>
diff --git a/www/about/index.html b/www/about/index.html
index 1bd0517..ce31568 100644
--- a/www/about/index.html
+++ b/www/about/index.html
@@ -1,5 +1,5 @@
<!DOCTYPE html>
-<html lang="en">
+<html>
<head>
<meta charset="utf-8" />
@@ -50,6 +50,21 @@ <h2>No really</h2>
</style>
+
+
+<footer>
+Copyright 2023 Coolio McCool. All rights reserved.<br>
+Made with <a href="https://github.com/nhanb/webmaker2000">WebMaker2000</a>.
+</footer>
+<style>
+footer {
+ margin-top: 2rem;
+ text-align: right;
+ font-size: 0.8rem;
+}
+</style>
+
+
</body>
</html>
diff --git a/www/hello/index.html b/www/hello/index.html
index 121a1e2..839d5b1 100644
--- a/www/hello/index.html
+++ b/www/hello/index.html
@@ -1,5 +1,5 @@
<!DOCTYPE html>
-<html lang="en">
+<html>
<head>
<meta charset="utf-8" />
@@ -49,6 +49,21 @@ <h1 class="post-title">Hello</h1>
</style>
+
+
+<footer>
+Copyright 2023 Coolio McCool. All rights reserved.<br>
+Made with <a href="https://github.com/nhanb/webmaker2000">WebMaker2000</a>.
+</footer>
+<style>
+footer {
+ margin-top: 2rem;
+ text-align: right;
+ font-size: 0.8rem;
+}
+</style>
+
+
</body>
</html>
diff --git a/www/index.html b/www/index.html
index e85d410..4b4b344 100644
--- a/www/index.html
+++ b/www/index.html
@@ -1,5 +1,5 @@
<!DOCTYPE html>
-<html lang="en">
+<html>
<head>
<meta charset="utf-8" />
@@ -85,6 +85,21 @@ <h1 class="site-title">CoolZone</h1>
}
</style>
+
+
+<footer>
+Copyright 2023 Coolio McCool. All rights reserved.<br>
+Made with <a href="https://github.com/nhanb/webmaker2000">WebMaker2000</a>.
+</footer>
+<style>
+footer {
+ margin-top: 2rem;
+ text-align: right;
+ font-size: 0.8rem;
+}
+</style>
+
+
</body>
</html>
diff --git a/www/mfws.html b/www/mfws.html
index fa54235..8c7eee6 100644
--- a/www/mfws.html
+++ b/www/mfws.html
@@ -1,5 +1,5 @@
<!DOCTYPE html>
-<html lang="en">
+<html>
<head>
<meta charset="utf-8" />
@@ -138,6 +138,21 @@ <h2>Epilogue</h2>
</style>
+
+
+<footer>
+Copyright 2023 Coolio McCool. All rights reserved.<br>
+Made with <a href="https://github.com/nhanb/webmaker2000">WebMaker2000</a>.
+</footer>
+<style>
+footer {
+ margin-top: 2rem;
+ text-align: right;
+ font-size: 0.8rem;
+}
+</style>
+
+
</body>
</html>
diff --git a/www/website.toml b/www/website.toml
index 1654c4a..c3a7f0b 100644
--- a/www/website.toml
+++ b/www/website.toml
@@ -2,6 +2,7 @@ Address = "https://coolzone.example.com"
Name = "CoolZone"
Tagline = "Cool people only."
HomePath = "/"
+DisableFooter = false
[Author]
Name = "Coolio McCool"