From 1b37ad9db8d80cc8423ea3452e17c6feeb38e4bc Mon Sep 17 00:00:00 2001 From: Hector Correa Date: Wed, 18 Oct 2023 16:39:47 -0400 Subject: [PATCH] Regenerate static site before loading the lcoal web server --- main.go | 5 +-- .../blog/2023-04-26-00002/topic-for-2023.html | 34 ------------------- .../blog/2023-04-26-00002/topic-for-2023.md | 3 -- .../blog/2023-04-26-00002/topic-for-2023.xml | 13 ------- sample/blog/rss.xml | 2 +- sample/blog/topic-for-2023/32.html | 1 - sample/blog/topic-for-2023/index.html | 1 - server.go | 5 +-- 8 files changed, 5 insertions(+), 59 deletions(-) delete mode 100644 sample/blog/2023-04-26-00002/topic-for-2023.html delete mode 100644 sample/blog/2023-04-26-00002/topic-for-2023.md delete mode 100644 sample/blog/2023-04-26-00002/topic-for-2023.xml delete mode 100644 sample/blog/topic-for-2023/32.html delete mode 100644 sample/blog/topic-for-2023/index.html diff --git a/main.go b/main.go index 7bee57f..62aead2 100644 --- a/main.go +++ b/main.go @@ -4,7 +4,6 @@ import ( "flag" "fmt" "io/fs" - "os" "path/filepath" "strings" ) @@ -26,12 +25,10 @@ func init() { func main() { fmt.Printf("fixie - a one gear static site generator\r\n\r\n") + processMarkdownFiles() if serverMode == true { server(port) - os.Exit(0) } - - processMarkdownFiles() } func processMarkdownFiles() { diff --git a/sample/blog/2023-04-26-00002/topic-for-2023.html b/sample/blog/2023-04-26-00002/topic-for-2023.html deleted file mode 100644 index 6e759b6..0000000 --- a/sample/blog/2023-04-26-00002/topic-for-2023.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - Fixie - - -
- Fixie || - About | - Blog -
- -
-

topic for 2023

- -

this is a topic for 2023

- - -
- - - - diff --git a/sample/blog/2023-04-26-00002/topic-for-2023.md b/sample/blog/2023-04-26-00002/topic-for-2023.md deleted file mode 100644 index 4289c6f..0000000 --- a/sample/blog/2023-04-26-00002/topic-for-2023.md +++ /dev/null @@ -1,3 +0,0 @@ -# topic for 2023 - -this is a topic for 2023 diff --git a/sample/blog/2023-04-26-00002/topic-for-2023.xml b/sample/blog/2023-04-26-00002/topic-for-2023.xml deleted file mode 100644 index a5b684d..0000000 --- a/sample/blog/2023-04-26-00002/topic-for-2023.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - Topic for 2023 - topic-for-2023 - Something something - 2023-09-04 23:53:32 - 2023-09-09 19:00:07 +0000 UTC - 2023-09-04 23:53:32 +0000 UTC - - oldId - 32 - - diff --git a/sample/blog/rss.xml b/sample/blog/rss.xml index 7949173..5bedc4d 100644 --- a/sample/blog/rss.xml +++ b/sample/blog/rss.xml @@ -10,7 +10,7 @@ topic for 2023 TODO /blog/2023-04-26-00002/topic-for-2023 - Wed, 26 Apr 2023 00:00:00 +0000 + Mon, 04 Sep 2023 00:00:00 +0000 Second diff --git a/sample/blog/topic-for-2023/32.html b/sample/blog/topic-for-2023/32.html deleted file mode 100644 index 17aedac..0000000 --- a/sample/blog/topic-for-2023/32.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/sample/blog/topic-for-2023/index.html b/sample/blog/topic-for-2023/index.html deleted file mode 100644 index 17aedac..0000000 --- a/sample/blog/topic-for-2023/index.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/server.go b/server.go index 1e2e69d..7295dd8 100644 --- a/server.go +++ b/server.go @@ -34,8 +34,9 @@ func server(port int) { // Start the web server webAddress := fmt.Sprintf("localhost:%d", port) - log.Printf("Listening for requests at: http://%s", webAddress) - log.Printf("Serving files from: %s", filePath) + fmt.Printf("\r\nLoading the local web server\r\n") + fmt.Printf("Listening for requests at: http://%s\r\n", webAddress) + fmt.Printf("Serving files from: %s\r\n", filePath) err := http.ListenAndServe(webAddress, nil) if err != nil { log.Fatal("Failed to start the web server: ", err)