🔧 Removed StaticURLPrefix config
This commit is contained in:
parent
fb93202373
commit
c42bef9895
|
@ -29,7 +29,6 @@ type (
|
||||||
Port string `env:"PORT" envDefault:"3000"`
|
Port string `env:"PORT" envDefault:"3000"`
|
||||||
Protocol string `env:"PROTOCOL" envDefault:"http"`
|
Protocol string `env:"PROTOCOL" envDefault:"http"`
|
||||||
RootURL string `env:"ROOT_URL" envDefault:"{{protocol}}://{{domain}}:{{port}}/"`
|
RootURL string `env:"ROOT_URL" envDefault:"{{protocol}}://{{domain}}:{{port}}/"`
|
||||||
StaticURLPrefix string `env:"STATIC_URL_PREFIX"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigDatabase struct {
|
ConfigDatabase struct {
|
||||||
|
@ -92,7 +91,6 @@ func TestConfig(tb testing.TB) *Config {
|
||||||
Port: "3000",
|
Port: "3000",
|
||||||
Protocol: "http",
|
Protocol: "http",
|
||||||
RootURL: "{{protocol}}://{{domain}}:{{port}}/",
|
RootURL: "{{protocol}}://{{domain}}:{{port}}/",
|
||||||
StaticURLPrefix: "/static",
|
|
||||||
},
|
},
|
||||||
Database: ConfigDatabase{
|
Database: ConfigDatabase{
|
||||||
Type: "memory",
|
Type: "memory",
|
||||||
|
@ -132,6 +130,5 @@ func (cs ConfigServer) GetRootURL() string {
|
||||||
"host": cs.Host,
|
"host": cs.Host,
|
||||||
"port": cs.Port,
|
"port": cs.Port,
|
||||||
"protocol": cs.Protocol,
|
"protocol": cs.Protocol,
|
||||||
"staticUrlPrefix": cs.StaticURLPrefix,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
2
main.go
2
main.go
|
@ -133,7 +133,7 @@ func init() {
|
||||||
logger.Fatalln("cannot parse root URL as client URL:", err)
|
logger.Fatalln("cannot parse root URL as client URL:", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if indieAuthClient.Logo[0], err = url.Parse(rootURL + config.Server.StaticURLPrefix + "/icon.svg"); err != nil {
|
if indieAuthClient.Logo[0], err = url.Parse(rootURL + "icon.svg"); err != nil {
|
||||||
logger.Fatalln("cannot parse root URL as client URL:", err)
|
logger.Fatalln("cannot parse root URL as client URL:", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,18 +39,18 @@ en
|
||||||
{% func (p *BaseOf) Head() %}
|
{% func (p *BaseOf) Head() %}
|
||||||
{% comment %}https://evilmartians.com/chronicles/how-to-favicon-in-2021-six-files-that-fit-most-needs{% endcomment %}
|
{% comment %}https://evilmartians.com/chronicles/how-to-favicon-in-2021-six-files-that-fit-most-needs{% endcomment %}
|
||||||
<link rel="icon"
|
<link rel="icon"
|
||||||
href="{%s p.Config.Server.StaticURLPrefix %}/favicon.ico"
|
href="/favicon.ico"
|
||||||
sizes="any">
|
sizes="any">
|
||||||
|
|
||||||
<link rel="icon"
|
<link rel="icon"
|
||||||
href="{%s p.Config.Server.StaticURLPrefix %}/icon.svg"
|
href="/icon.svg"
|
||||||
type="image/svg+xml">
|
type="image/svg+xml">
|
||||||
|
|
||||||
<link rel="apple-touch-icon"
|
<link rel="apple-touch-icon"
|
||||||
href="{%s p.Config.Server.StaticURLPrefix %}/apple-touch-icon.png">
|
href="/apple-touch-icon.png">
|
||||||
|
|
||||||
<link rel="manifest"
|
<link rel="manifest"
|
||||||
href="{%s p.Config.Server.StaticURLPrefix %}/manifest.webmanifest">
|
href="/manifest.webmanifest">
|
||||||
{% endfunc %}
|
{% endfunc %}
|
||||||
|
|
||||||
{% func (p *BaseOf) Body() %}{% endfunc %}
|
{% func (p *BaseOf) Body() %}{% endfunc %}
|
||||||
|
|
|
@ -152,23 +152,7 @@ func (p *BaseOf) StreamHead(qw422016 *qt422016.Writer) {
|
||||||
//line web/baseof.qtpl:39
|
//line web/baseof.qtpl:39
|
||||||
qw422016.N().S(` `)
|
qw422016.N().S(` `)
|
||||||
//line web/baseof.qtpl:40
|
//line web/baseof.qtpl:40
|
||||||
qw422016.N().S(` <link rel="icon" href="`)
|
qw422016.N().S(` <link rel="icon" href="/favicon.ico" sizes="any"> <link rel="icon" href="/icon.svg" type="image/svg+xml"> <link rel="apple-touch-icon" href="/apple-touch-icon.png"> <link rel="manifest" href="/manifest.webmanifest"> `)
|
||||||
//line web/baseof.qtpl:42
|
|
||||||
qw422016.E().S(p.Config.Server.StaticURLPrefix)
|
|
||||||
//line web/baseof.qtpl:42
|
|
||||||
qw422016.N().S(`/favicon.ico" sizes="any"> <link rel="icon" href="`)
|
|
||||||
//line web/baseof.qtpl:46
|
|
||||||
qw422016.E().S(p.Config.Server.StaticURLPrefix)
|
|
||||||
//line web/baseof.qtpl:46
|
|
||||||
qw422016.N().S(`/icon.svg" type="image/svg+xml"> <link rel="apple-touch-icon" href="`)
|
|
||||||
//line web/baseof.qtpl:50
|
|
||||||
qw422016.E().S(p.Config.Server.StaticURLPrefix)
|
|
||||||
//line web/baseof.qtpl:50
|
|
||||||
qw422016.N().S(`/apple-touch-icon.png"> <link rel="manifest" href="`)
|
|
||||||
//line web/baseof.qtpl:53
|
|
||||||
qw422016.E().S(p.Config.Server.StaticURLPrefix)
|
|
||||||
//line web/baseof.qtpl:53
|
|
||||||
qw422016.N().S(`/manifest.webmanifest"> `)
|
|
||||||
//line web/baseof.qtpl:54
|
//line web/baseof.qtpl:54
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue