added dep on feeds, some cleanup
This commit is contained in:
parent
6e7ca75c11
commit
9fc816c300
5
go.mod
5
go.mod
|
@ -2,4 +2,7 @@ module tildegit.org/nihilazo/sitegenerator
|
|||
|
||||
go 1.15
|
||||
|
||||
require tildegit.org/nihilazo/go-gemtext v0.0.0-20201114202124-890be6eb3742
|
||||
require (
|
||||
github.com/gorilla/feeds v1.1.1 // indirect
|
||||
tildegit.org/nihilazo/go-gemtext v0.0.0-20201114202124-890be6eb3742
|
||||
)
|
||||
|
|
2
go.sum
2
go.sum
|
@ -1,2 +1,4 @@
|
|||
github.com/gorilla/feeds v1.1.1 h1:HwKXxqzcRNg9to+BbvJog4+f3s/xzvtZXICcQGutYfY=
|
||||
github.com/gorilla/feeds v1.1.1/go.mod h1:Nk0jZrvPFZX1OBe5NPiddPw7CfwF6Q9eqzaBbaightA=
|
||||
tildegit.org/nihilazo/go-gemtext v0.0.0-20201114202124-890be6eb3742 h1:SE9EroZwQEH3mHxWah4UoHQGgBTa008VIjmh2PqSZXw=
|
||||
tildegit.org/nihilazo/go-gemtext v0.0.0-20201114202124-890be6eb3742/go.mod h1:KOdDbr9CNSpgmfNfCEjpDhaGPCd86Mp5+XGrZDBKZvo=
|
||||
|
|
8
main.go
8
main.go
|
@ -10,7 +10,7 @@ import (
|
|||
"path/filepath"
|
||||
"strings"
|
||||
"tildegit.org/nihilazo/go-gemtext"
|
||||
//ht "html/template"
|
||||
"github.com/gorilla/feeds"
|
||||
t "text/template"
|
||||
)
|
||||
|
||||
|
@ -124,9 +124,9 @@ func processLinkString(s string, mode int) (string, error) {
|
|||
return "", err
|
||||
}
|
||||
if mode == GEMINI {
|
||||
o = filepath.Join(geminiPrefix, o)
|
||||
o = geminiPrefix + "/" + o
|
||||
} else if mode == HTML {
|
||||
o = filepath.Join(htmlPrefix, strings.Replace(o, ".gmi", ".html", -1))
|
||||
o = htmlPrefix + "/" + strings.Replace(o, ".gmi", ".html", -1)
|
||||
}
|
||||
return o, nil
|
||||
}
|
||||
|
@ -198,8 +198,6 @@ func processPage(f filePathInfo) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
} else if filepath.Ext(f.Path) == ".tpl" {
|
||||
// TODO handle template files
|
||||
} else { // Non-gemtext files
|
||||
rel, err := filepath.Rel(inputDir, f.Path)
|
||||
if err != nil {
|
||||
|
|
Reference in New Issue