This commit is contained in:
@@ -14,8 +14,8 @@ steps:
|
|||||||
commands:
|
commands:
|
||||||
#- pandoc --standalone --output=index.html --metadata title="SMT Readme" -t html5 README.md
|
#- pandoc --standalone --output=index.html --metadata title="SMT Readme" -t html5 README.md
|
||||||
# From https://gitlab.com/vimalkvn/pandoc-mvp-css
|
# From https://gitlab.com/vimalkvn/pandoc-mvp-css
|
||||||
- pandoc -s README.md --toc --toc-depth=2 -c css/mvp.css --template template.html -o index.html
|
- pandoc -s README.md --toc --toc-depth=2 -c www/mvp.css --template template.html -o ./www/index.html -metadata title="SMT Readme"
|
||||||
- cp index.html /shared/index.html
|
- cp ./www/index.html /shared/index.html
|
||||||
|
|
||||||
- name: build
|
- name: build
|
||||||
image: golang
|
image: golang
|
||||||
@@ -23,7 +23,7 @@ steps:
|
|||||||
- name: shared
|
- name: shared
|
||||||
path: /shared
|
path: /shared
|
||||||
commands:
|
commands:
|
||||||
- cp /shared/index.html .
|
- cp /shared/index.html ./www/
|
||||||
- sh ./.drone.sh
|
- sh ./.drone.sh
|
||||||
|
|
||||||
# Copy binary to test server
|
# Copy binary to test server
|
||||||
|
6
main.go
6
main.go
@@ -29,7 +29,7 @@ type Replacements map[string]string
|
|||||||
|
|
||||||
var replacements = make(Replacements)
|
var replacements = make(Replacements)
|
||||||
|
|
||||||
//go:embed index.htm
|
//go:embed www
|
||||||
var staticContent embed.FS
|
var staticContent embed.FS
|
||||||
|
|
||||||
// staticFileServer serves files from the provided fs.FS
|
// staticFileServer serves files from the provided fs.FS
|
||||||
@@ -40,8 +40,8 @@ func staticFileServer(content embed.FS) gin.HandlerFunc {
|
|||||||
|
|
||||||
// Root request should load index.htm
|
// Root request should load index.htm
|
||||||
if len(fileName) == 1 {
|
if len(fileName) == 1 {
|
||||||
log.Printf("staticFileServer replacing root request with index.htm")
|
log.Printf("staticFileServer replacing root request with index.html")
|
||||||
fileName = "index.htm"
|
fileName = "index.html"
|
||||||
}
|
}
|
||||||
|
|
||||||
//log.Printf("staticFileServer attempting to load filename '%s'\n", fileName)
|
//log.Printf("staticFileServer attempting to load filename '%s'\n", fileName)
|
||||||
|
Reference in New Issue
Block a user