{% import "fmt" %} {% import "path/filepath" %} {% import "github.com/bouncepaw/mycorrhiza/cfg" %} {% import "github.com/bouncepaw/mycorrhiza/hyphae" %} {% import "github.com/bouncepaw/mycorrhiza/user" %} {% import "github.com/bouncepaw/mycorrhiza/util" %} {% import "github.com/bouncepaw/mycorrhiza/l18n" %} {% func Base(title, body string, lc *l18n.Localizer, u *user.User, headElements ...string) %} {%s title %} {% for _, el := range headElements %}{%s= el %}{% endfor %}
{%s= body %} {%= commonScripts() %} {% endfunc %} {% func TitleSearch(query string, generator func(string) <-chan string, lc *l18n.Localizer) %}

{%s lc.Get("ui.search_results_query", &l18n.Replacements{"query": query})%}

{%s lc.Get("ui.search_results_desc")%}

{% endfunc %} {% func Backlinks(hyphaName string, generator func(string) <-chan string, lc *l18n.Localizer) %}

{%s= lc.Get( "ui.backlinks_heading", &l18n.Replacements{ "hypha_link": fmt.Sprintf( `%s`, hyphaName, util.BeautifulName(hyphaName), ), }, )%}

{%s lc.Get("ui.backlinks_desc")%}

{% endfunc %} {% func Help(content, lang string, lc *l18n.Localizer) %}
{%s= content %}
{%s= helpTopics(lang, lc) %}
{% endfunc %} {% func HelpEmptyError(lc *l18n.Localizer) %}

{%s lc.Get("help.empty_error_title") %}

{%s lc.Get("help.empty_error_line_1") %}

{%s lc.Get("help.empty_error_line_2a") %} {%s lc.Get("help.empty_error_link") %} {%s lc.Get("help.empty_error_line_2b") %}

{% endfunc %} {% func HyphaList(lc *l18n.Localizer) %}

{%s lc.Get("ui.list_heading") %}

{%s lc.GetPlural("ui.list_desc", hyphae.Count()) %}

{% endfunc %} {% func commonScripts() %} {% for _, scriptPath := range cfg.CommonScripts %} {% endfor %} {% endfunc %}