From 33de466470bd80c8f250878a28678e5db3550d02 Mon Sep 17 00:00:00 2001 From: Hau Nguyen Date: Fri, 30 Dec 2022 17:08:50 +0700 Subject: [PATCH] feat: only show index in posts --- docs/2022-06-08-backup.html | 4 +--- docs/2022-06-08-dockerfile-go.html | 4 +--- docs/2022-07-10-bootstrap-go.html | 4 +--- docs/2022-07-12-uuid-or-else.html | 4 +--- docs/2022-07-19-migrate-to-buf.html | 4 +--- docs/2022-07-31-experiment-go.html | 4 +--- docs/2022-07-31-sql.html | 4 +--- docs/2022-08-10-gitignore.html | 4 +--- docs/2022-10-26-reload-config.html | 4 +--- docs/2022-12-25-archlinux.html | 4 +--- docs/2022-12-25-go-buf.html | 4 +--- docs/2022-12-25-go-test-asap.html | 4 +--- docs/index.html | 3 --- main.go | 12 ++++++++++-- templates/post.html | 5 +---- 15 files changed, 23 insertions(+), 45 deletions(-) diff --git a/docs/2022-06-08-backup.html b/docs/2022-06-08-backup.html index 80e316c..fde2080 100644 --- a/docs/2022-06-08-backup.html +++ b/docs/2022-06-08-backup.html @@ -40,9 +40,7 @@ } -
- Index -
+
Index

-
- Index -
+
Index

-
- Index -
+
Index

-
- Index -
+
Index

-
- Index -
+
Index

-
- Index -
+
Index

-
- Index -
+
Index

-
- Index -
+
Index

-
- Index -
+
Index

-
- Index -
+
Index

-
- Index -
+
Index

-
- Index -
+
Index

-
- Index -

Index` + if strings.Contains(postFilename, "index") { + indexHTML = "" + } + if err := templatePost.Execute(htmlFile, templatePostData{ - Body: ghMarkdown, + Index: indexHTML, + Body: ghMarkdown, }); err != nil { return fmt.Errorf("template: failed to execute: %w", err) } diff --git a/templates/post.html b/templates/post.html index f7a5543..c12b022 100644 --- a/templates/post.html +++ b/templates/post.html @@ -40,10 +40,7 @@ } -
- Index -
- {{.Body}} + {{.Index}} {{.Body}}
Feel free to ask me via email or