Merge pull request #206 from alexef/docs-config

Docs URL configuration
This commit is contained in:
Laszlo Fogas 2021-05-27 16:09:44 +02:00 committed by GitHub
commit 62d3dd205e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 5 deletions

View file

@ -118,6 +118,12 @@ var flags = []cli.Flag{
Usage: "file path for the drone config", Usage: "file path for the drone config",
Value: ".drone.yml", Value: ".drone.yml",
}, },
cli.StringFlag{
EnvVar: "DRONE_DOCS,WOODPECKER_DOCS",
Name: "docs",
Usage: "link to user documentation",
Value: "https://woodpecker.laszlo.cloud",
},
cli.DurationFlag{ cli.DurationFlag{
EnvVar: "DRONE_SESSION_EXPIRES,WOODPECKER_SESSION_EXPIRES", EnvVar: "DRONE_SESSION_EXPIRES,WOODPECKER_SESSION_EXPIRES",
Name: "session-expires", Name: "session-expires",

View file

@ -203,6 +203,7 @@ func setupTree(c *cli.Context) *httptreemux.ContextMux {
web.New( web.New(
web.WithDir(c.String("www")), web.WithDir(c.String("www")),
web.WithSync(time.Hour*72), web.WithSync(time.Hour*72),
web.WithDocs(c.String("docs")),
).Register(tree) ).Register(tree)
return tree return tree
} }

View file

@ -171,11 +171,7 @@ const LOGO = (
Woodpecker<span style="margin-left: 4px;">{window.DRONE_VERSION}</span> Woodpecker<span style="margin-left: 4px;">{window.DRONE_VERSION}</span>
<br /> <br />
<span> <span>
<a <a href={window.DRONE_DOCS} target="_blank" rel="noopener noreferrer">
href="https://woodpecker.laszlo.cloud"
target="_blank"
rel="noopener noreferrer"
>
Docs Docs
</a> </a>
</span> </span>