1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2025-06-21 11:24:04 +00:00

Rename -user-tree to -user-hypha

This commit is contained in:
bouncepaw 2021-01-23 21:37:29 +05:00
parent e72ca863e3
commit 84545dd9f1
8 changed files with 10 additions and 10 deletions

View File

@ -32,7 +32,7 @@ Options:
Port to serve the wiki at (default "1737") Port to serve the wiki at (default "1737")
-url string -url string
URL at which your wiki can be found. Used to generate feeds (default "http://0.0.0.0:$port") URL at which your wiki can be found. Used to generate feeds (default "http://0.0.0.0:$port")
-user-tree string -user-hypha string
Hypha which is a superhypha of all user pages (default "u") Hypha which is a superhypha of all user pages (default "u")
``` ```

View File

@ -15,7 +15,7 @@ func init() {
flag.StringVar(&util.HomePage, "home", "home", "The home page name") flag.StringVar(&util.HomePage, "home", "home", "The home page name")
flag.StringVar(&util.SiteNavIcon, "icon", "🍄", "What to show in the navititle in the beginning, before the colon") flag.StringVar(&util.SiteNavIcon, "icon", "🍄", "What to show in the navititle in the beginning, before the colon")
flag.StringVar(&util.SiteName, "name", "wiki", "What is the name of your wiki") flag.StringVar(&util.SiteName, "name", "wiki", "What is the name of your wiki")
flag.StringVar(&util.UserTree, "user-tree", "u", "Hypha which is a superhypha of all user pages") flag.StringVar(&util.UserHypha, "user-hypha", "u", "Hypha which is a superhypha of all user pages")
flag.StringVar(&util.AuthMethod, "auth-method", "none", "What auth method to use. Variants: \"none\", \"fixed\"") flag.StringVar(&util.AuthMethod, "auth-method", "none", "What auth method to use. Variants: \"none\", \"fixed\"")
flag.StringVar(&util.FixedCredentialsPath, "fixed-credentials-path", "mycocredentials.json", "Used when -auth-method=fixed. Path to file with user credentials.") flag.StringVar(&util.FixedCredentialsPath, "fixed-credentials-path", "mycocredentials.json", "Used when -auth-method=fixed. Path to file with user credentials.")
} }
@ -44,8 +44,8 @@ func parseCliArgs() {
log.Fatal("Error: you must use a proper name for the homepage") log.Fatal("Error: you must use a proper name for the homepage")
} }
if !isCanonicalName(util.UserTree) { if !isCanonicalName(util.UserHypha) {
log.Fatal("Error: you must use a proper name for user tree") log.Fatal("Error: you must use a proper name for user hypha")
} }
switch util.AuthMethod { switch util.AuthMethod {

View File

@ -118,7 +118,7 @@ func (rev Revision) RecentChangesEntry() (html string) {
<li class="rc-entry__hash">%[2]s</li> <li class="rc-entry__hash">%[2]s</li>
<li class="rc-entry__links">%[5]s</li> <li class="rc-entry__links">%[5]s</li>
<li class="rc-entry__msg">%[6]s <span class="rc-entry__author">by <a href="/page/%[3]s/%[4]s" rel="author">%[4]s</a></span></li> <li class="rc-entry__msg">%[6]s <span class="rc-entry__author">by <a href="/page/%[3]s/%[4]s" rel="author">%[4]s</a></span></li>
`, rev.TimeString(), rev.Hash, util.UserTree, rev.Username, rev.HyphaeLinks(), rev.Message) `, rev.TimeString(), rev.Hash, util.UserHypha, rev.Username, rev.HyphaeLinks(), rev.Message)
} }
return fmt.Sprintf(` return fmt.Sprintf(`
<li class="rc-entry__time"><time>%[1]s</time></li> <li class="rc-entry__time"><time>%[1]s</time></li>

View File

@ -142,7 +142,7 @@ func (rev *Revision) asHistoryEntry(hyphaName string) (html string) {
author := "" author := ""
if rev.Username != "anon" { if rev.Username != "anon" {
author = fmt.Sprintf(` author = fmt.Sprintf(`
<span class="history-entry__author">by <a href="/page/%[1]s/%[2]s" rel="author">%[2]s</span>`, util.UserTree, rev.Username) <span class="history-entry__author">by <a href="/page/%[1]s/%[2]s" rel="author">%[2]s</span>`, util.UserHypha, rev.Username)
} }
return fmt.Sprintf(` return fmt.Sprintf(`
<li class="history__entry"> <li class="history__entry">

View File

@ -52,7 +52,7 @@ var navEntries = []navEntry{
{% if u.Group == "anon" %} {% if u.Group == "anon" %}
<a href="/login">Login</a> <a href="/login">Login</a>
{% else %} {% else %}
<a href="/page/{%s util.UserTree %}/{%s u.Name %}">{%s u.Name %}</a> <a href="/page/{%s util.UserHypha %}/{%s u.Name %}">{%s u.Name %}</a>
{% endif %} {% endif %}
</li> </li>
{% endif %} {% endif %}

View File

@ -166,7 +166,7 @@ func streamuserMenuHTML(qw422016 *qt422016.Writer, u *user.User) {
qw422016.N().S(` qw422016.N().S(`
<a href="/page/`) <a href="/page/`)
//line templates/common.qtpl:55 //line templates/common.qtpl:55
qw422016.E().S(util.UserTree) qw422016.E().S(util.UserHypha)
//line templates/common.qtpl:55 //line templates/common.qtpl:55
qw422016.N().S(`/`) qw422016.N().S(`/`)
//line templates/common.qtpl:55 //line templates/common.qtpl:55

View File

@ -57,7 +57,7 @@
<li><b>Administrators:</b> {%- for i, username := range user.ListUsersWithGroup("admin") -%} <li><b>Administrators:</b> {%- for i, username := range user.ListUsersWithGroup("admin") -%}
{%- if i > 0 -%}<span aria-hidden="true">, </span> {%- if i > 0 -%}<span aria-hidden="true">, </span>
{%- endif -%} {%- endif -%}
<a href="/page/{%s util.UserTree %}/{%s username %}">{%s username %}</a>{%- endfor -%}</li> <a href="/page/{%s util.UserHypha %}/{%s username %}">{%s username %}</a>{%- endfor -%}</li>
{%- else -%} {%- else -%}
<li>This wiki does not use authorization</li> <li>This wiki does not use authorization</li>
{%- endif -%} {%- endif -%}

View File

@ -14,7 +14,7 @@ var (
SiteNavIcon string SiteNavIcon string
SiteName string SiteName string
WikiDir string WikiDir string
UserTree string UserHypha string
AuthMethod string AuthMethod string
FixedCredentialsPath string FixedCredentialsPath string
) )