diff --git a/templates/example.tmpl b/templates/example.tmpl index 8aa7db44b..449871f9e 100644 --- a/templates/example.tmpl +++ b/templates/example.tmpl @@ -9,12 +9,12 @@ onkeydown = (e) => { {{if .PrevExample}} if (e.key == "ArrowLeft") { - window.location.href = '{{.PrevExample.ID}}'; + window.location.href = '{{.PrevExample.ID}}.html'; } {{end}} {{if .NextExample}} if (e.key == "ArrowRight") { - window.location.href = '{{.NextExample.ID}}'; + window.location.href = '{{.NextExample.ID}}.html'; } {{end}} } @@ -39,7 +39,7 @@ {{end}} {{if .NextExample}}

- Наступний приклад: {{.NextExample.Name}}. + Наступний приклад: {{.NextExample.Name}}.

{{end}} {{ template "footer" }} diff --git a/templates/index.tmpl b/templates/index.tmpl index 1cfc5d36c..cfabc4e60 100644 --- a/templates/index.tmpl +++ b/templates/index.tmpl @@ -32,7 +32,7 @@ {{ template "footer" }} diff --git a/tools/generate.go b/tools/generate.go index a21bacbf3..96f8021d0 100644 --- a/tools/generate.go +++ b/tools/generate.go @@ -320,7 +320,7 @@ func renderExamples(examples []*Example) { template.Must(exampleTmpl.Parse(mustReadFile("templates/footer.tmpl"))) template.Must(exampleTmpl.Parse(mustReadFile("templates/example.tmpl"))) for _, example := range examples { - exampleF, err := os.Create(siteDir + "/" + example.ID) + exampleF, err := os.Create(siteDir + "/" + example.ID + ".html") check(err) defer exampleF.Close() check(exampleTmpl.Execute(exampleF, example))