Skip to content

Commit

Permalink
feat: reorganize project structure
Browse files Browse the repository at this point in the history
  • Loading branch information
K-Sato1995 committed Jan 25, 2024
1 parent cc52c20 commit b66dd6a
Show file tree
Hide file tree
Showing 17 changed files with 9 additions and 267 deletions.
2 changes: 1 addition & 1 deletion builder/generateDetail.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package builder
import (
"bytes"
"fmt"
"go-simple-ssg/parser"
"html/template"
"io/ioutil"
"os"
"path/filepath"
"site-generator/parser"
"strings"
)

Expand Down
16 changes: 0 additions & 16 deletions contents/test.md

This file was deleted.

22 changes: 0 additions & 22 deletions contents/testMd.md

This file was deleted.

26 changes: 3 additions & 23 deletions main.go → engine.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package main
package engine

import (
"go-simple-ssg/builder"
"go-simple-ssg/config"
"log"
"net/http"
"site-generator/builder"
"site-generator/config"
)

type Engine struct {
Expand Down Expand Up @@ -33,22 +32,3 @@ func (e *Engine) Build() {
// Create list page
builder.GenerateListPage(articles, e.Config.TemplatePath, e.Config.GeneratedPath)
}

func main() {
baseConfig := config.NewConfig(config.Config{})
engine := New(baseConfig)
engine.Build()
serveFiles()

}

func serveFiles() {
fs := http.FileServer(http.Dir(config.GENERATED_HTML_DIR))
http.Handle("/", fs)

log.Println("Serving files on http://localhost:8080...")
err := http.ListenAndServe(":8081", nil)
if err != nil {
log.Fatal(err)
}
}
7 changes: 0 additions & 7 deletions generated/detail.css

This file was deleted.

7 changes: 0 additions & 7 deletions generated/layout.css

This file was deleted.

15 changes: 0 additions & 15 deletions generated/list.css

This file was deleted.

24 changes: 0 additions & 24 deletions generated/list.html

This file was deleted.

34 changes: 0 additions & 34 deletions generated/test.html

This file was deleted.

45 changes: 0 additions & 45 deletions generated/testMd.html

This file was deleted.

12 changes: 5 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
module site-generator
module go-simple-ssg

go 1.21.6

require github.com/gomarkdown/markdown v0.0.0-20231222211730-1d6d20845b47

require (
github.com/evanw/esbuild v0.19.12 // indirect
github.com/wellington/go-libsass v0.9.2 // indirect
golang.org/x/net v0.20.0 // indirect
golang.org/x/sys v0.16.0 // indirect
github.com/evanw/esbuild v0.19.12
github.com/gomarkdown/markdown v0.0.0-20231222211730-1d6d20845b47
)

require golang.org/x/sys v0.16.0 // indirect
5 changes: 0 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ github.com/evanw/esbuild v0.19.12 h1:p5WGo4o6TCN+kt+uZtYSGS3ZHPa+iIZ0SX+ys8UnP10
github.com/evanw/esbuild v0.19.12/go.mod h1:D2vIQZqV/vIf/VRHtViaUtViZmG7o+kKmlBfVQuRi48=
github.com/gomarkdown/markdown v0.0.0-20231222211730-1d6d20845b47 h1:k4Tw0nt6lwro3Uin8eqoET7MDA4JnT8YgbCjc/g5E3k=
github.com/gomarkdown/markdown v0.0.0-20231222211730-1d6d20845b47/go.mod h1:JDGcbDT52eL4fju3sZ4TeHGsQwhG9nbDV21aMyhwPoA=
github.com/wellington/go-libsass v0.9.2 h1:6Ims04UDdBs6/CGSVK5JC8FNikR5ssrsMMKE/uaO5Q8=
github.com/wellington/go-libsass v0.9.2/go.mod h1:mxgxgam0N0E+NAUMHLcu20Ccfc3mVpDkyrLDayqfiTs=
golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo=
golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 h1:0A+M6Uqn+Eje4kHMK80dtF3JCXC4ykBgQG4Fe06QRhQ=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
7 changes: 0 additions & 7 deletions templates/detail.css

This file was deleted.

18 changes: 0 additions & 18 deletions templates/detail.html

This file was deleted.

7 changes: 0 additions & 7 deletions templates/layout.css

This file was deleted.

7 changes: 0 additions & 7 deletions templates/list.css

This file was deleted.

22 changes: 0 additions & 22 deletions templates/list.html

This file was deleted.

0 comments on commit b66dd6a

Please sign in to comment.