From b1489cf11f07080db4eac529b181e3e2498f9383 Mon Sep 17 00:00:00 2001 From: Timur Ismagilov Date: Mon, 12 Jul 2021 15:01:53 +0500 Subject: [PATCH] Move the main help page It was on /help/en/index, now it is on both /help/en and /help --- help/{en/index.myco => en.myco} | 0 help/help.go | 5 ++++- views/stuff.qtpl | 2 +- views/stuff.qtpl.go | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) rename help/{en/index.myco => en.myco} (100%) diff --git a/help/en/index.myco b/help/en.myco similarity index 100% rename from help/en/index.myco rename to help/en.myco diff --git a/help/help.go b/help/help.go index 06fc6f1..bc12477 100644 --- a/help/help.go +++ b/help/help.go @@ -5,11 +5,14 @@ import ( "embed" ) -//go:embed en +//go:embed en en.myco var fs embed.FS // Get determines what help text you need and returns it. The path is a substring from URL, it follows this form: // / func Get(path string) ([]byte, error) { + if path == "" { + return Get("en") + } return fs.ReadFile(path + ".myco") } diff --git a/views/stuff.qtpl b/views/stuff.qtpl index ddd18d1..f068f16 100644 --- a/views/stuff.qtpl +++ b/views/stuff.qtpl @@ -66,7 +66,7 @@

Help topics

  • - Main + Main
  • Hypha diff --git a/views/stuff.qtpl.go b/views/stuff.qtpl.go index 487218f..b330c4f 100644 --- a/views/stuff.qtpl.go +++ b/views/stuff.qtpl.go @@ -236,7 +236,7 @@ func streamhelpTopicsHTML(qw422016 *qt422016.Writer) {

    Help topics