Skip to content

Commit

Permalink
Regenerate static site before loading the lcoal web server
Browse files Browse the repository at this point in the history
  • Loading branch information
hectorcorrea committed Oct 18, 2023
1 parent 445dcbf commit 1b37ad9
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 59 deletions.
5 changes: 1 addition & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"flag"
"fmt"
"io/fs"
"os"
"path/filepath"
"strings"
)
Expand All @@ -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() {
Expand Down
34 changes: 0 additions & 34 deletions sample/blog/2023-04-26-00002/topic-for-2023.html

This file was deleted.

3 changes: 0 additions & 3 deletions sample/blog/2023-04-26-00002/topic-for-2023.md

This file was deleted.

13 changes: 0 additions & 13 deletions sample/blog/2023-04-26-00002/topic-for-2023.xml

This file was deleted.

2 changes: 1 addition & 1 deletion sample/blog/rss.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<title>topic for 2023</title>
<description>TODO</description>
<guid isPermaLink="true">/blog/2023-04-26-00002/topic-for-2023</guid>
<pubDate>Wed, 26 Apr 2023 00:00:00 +0000</pubDate>
<pubDate>Mon, 04 Sep 2023 00:00:00 +0000</pubDate>
</item>
<item>
<title>Second</title>
Expand Down
1 change: 0 additions & 1 deletion sample/blog/topic-for-2023/32.html

This file was deleted.

1 change: 0 additions & 1 deletion sample/blog/topic-for-2023/index.html

This file was deleted.

5 changes: 3 additions & 2 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1b37ad9

Please sign in to comment.