Skip to content

Commit

Permalink
Use text/template
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kus committed Nov 13, 2020
1 parent 75a6a8b commit c7f55c0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions scripts/nginx/nginx.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ package main
import (
"bytes"
"fmt"
"html"
"html/template"
"os"
"strings"
"text/template"

"github.com/baking-bad/bcdhub/internal/config"
"github.com/baking-bad/bcdhub/internal/logger"
Expand Down Expand Up @@ -60,7 +59,7 @@ func makeDappLocation(dapp tzip.DApp, baseURL string) string {
}

buf := &bytes.Buffer{}
tmpl := template.Must(template.New("").Parse(html.EscapeString(dappLocationTemplate)))
tmpl := template.Must(template.New("").Parse(dappLocationTemplate))

err := tmpl.Execute(buf, map[string]interface{}{
"slug": dapp.Slug,
Expand All @@ -77,7 +76,7 @@ func makeDappLocation(dapp tzip.DApp, baseURL string) string {
logger.Fatal(err)
}

return html.UnescapeString(html.UnescapeString(buf.String()))
return buf.String()
}

func makeNginxConfig(ctx *config.Context, dapps []tzip.DApp, outputDir string) error {
Expand Down

0 comments on commit c7f55c0

Please sign in to comment.